Skip to content

Commit

Permalink
fix the stack message
Browse files Browse the repository at this point in the history
  • Loading branch information
cherifGsoul committed Jan 11, 2019
1 parent eaf8a98 commit 86a7944
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ext/npm-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,12 @@ exports.addExtension = function addNpmExtension(System){
if ((statusCode === 404 || statusCode === 0) &&
utils.moduleName.isBareIdentifier(load.name) &&
!utils.pkg.isRoot(loader, load.metadata.npmPackage)) {
var errorMsg = ["Could not load '" + load.name + "'",
var newError = new Error([
"Could not load '" + load.name + "'",
"Is this an npm module not saved in your package.json?"
].join("\n");
var newError = new Error();
].join("\n"));
newError.statusCode = error.statusCode;
newError.stack = newError.stack + error.stack;
newError.message = errorMsg;

throw newError;
} else {
throw error;
Expand Down

0 comments on commit 86a7944

Please sign in to comment.