[Pkg-javascript-commits] [node-browser-pack] 94/141: set err.code to MODULE_NOT_FOUND

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-browser-pack.

commit e91264e3e4c6534e3c59e980eb0bc7768b7aabc5
Author: James Halliday <mail at substack.net>
Date:   Thu Jul 24 15:23:53 2014 -0700

    set err.code to MODULE_NOT_FOUND
---
 prelude.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/prelude.js b/prelude.js
index 2b7e4c3..3cbac8e 100644
--- a/prelude.js
+++ b/prelude.js
@@ -25,7 +25,9 @@
                 // many times as there are bundles until the module is found or
                 // we exhaust the require chain.
                 if (previousRequire) return previousRequire(name, true);
-                throw new Error('Cannot find module \'' + name + '\'');
+                var err = new Error('Cannot find module \'' + name + '\'');
+                err.code = 'MODULE_NOT_FOUND';
+                throw err;
             }
             var m = cache[name] = {exports:{}};
             modules[name][0].call(m.exports, function(x){

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list