improve JsImage.load Npm.require errors

- Use buildmessage (skips stack trace)
- Drop extraneous trailing single quote
- Say "from" instead of "while loading" since this can also happen
  when running code from the file after load time
This commit is contained in:
David Glasser
2015-01-23 16:47:49 -08:00
parent 806ecd827b
commit 71af635a25

View File

@@ -1329,9 +1329,10 @@ _.extend(JsImage.prototype, {
try {
return require(name);
} catch (e) {
throw new Error("Can't load npm module '" + name +
"' while loading " + item.targetPath +
". Check your Npm.depends().'");
buildmessage.error(
"Can't load npm module '" + name + "' from " +
item.targetPath + ". Check your Npm.depends().");
return undefined;
}
}
},