From 71af635a2579f0ce9914951c3ce5455f21d482ca Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 23 Jan 2015 16:47:49 -0800 Subject: [PATCH] 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 --- tools/bundler.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/bundler.js b/tools/bundler.js index 6edc039dab..95a3529bd7 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -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; } } },