From 487b41fd7563e1afa623c62e248277d0d7ae25e0 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 24 Nov 2016 16:12:10 +0200 Subject: [PATCH] Improve compiler error when asset is added with empty contents While not a Meteor bug, this makes the error message more helpful when a compiler tries adding an asset without data, as demonstrated in meteor/meteor#8034. Thanks to suggestion by @sdarnell for this. Closes meteor/meteor#8034 --- tools/isobuild/compiler-plugin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/isobuild/compiler-plugin.js b/tools/isobuild/compiler-plugin.js index b93100387d..482903b067 100644 --- a/tools/isobuild/compiler-plugin.js +++ b/tools/isobuild/compiler-plugin.js @@ -726,7 +726,8 @@ class ResourceSlot { if (_.isString(options.data)) { options.data = new Buffer(options.data); } else { - throw new Error("'data' option to addAsset must be a Buffer or String."); + throw new Error("'data' option to addAsset must be a Buffer or " + + "String: " + self.inputResource.path); } }