From 86a7944e1578550796f7003c0b9faffc408ec445 Mon Sep 17 00:00:00 2001 From: Cherif BOUCHELAGHEM Date: Fri, 11 Jan 2019 20:51:15 +0100 Subject: [PATCH] fix the stack message --- ext/npm-extension.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/npm-extension.js b/ext/npm-extension.js index fb180d0a2..9e0f0c5bb 100644 --- a/ext/npm-extension.js +++ b/ext/npm-extension.js @@ -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;