[Pkg-javascript-commits] [node-module-deps] 57/444: emit error objects, not strings

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:43 UTC 2017


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

rouca pushed a commit to branch master
in repository node-module-deps.

commit 694b4008a27515905e704baf1f644282a5c6b8fc
Author: James Halliday <mail at substack.net>
Date:   Wed Mar 6 10:45:52 2013 -0800

    emit error objects, not strings
---
 index.js     | 8 ++++----
 package.json | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index de4c3e6..eb23e09 100644
--- a/index.js
+++ b/index.js
@@ -52,10 +52,10 @@ module.exports = function (mains, opts) {
         
         resolve(id, parent, function (err, file) {
             if (err) return output.emit('error', err);
-            if (!file) return output.emit('error', [
+            if (!file) return output.emit('error', new Error([
                 'module not found: "' + id + '" from file ',
                 parent.filename
-            ].join(''));
+            ].join('')));
             if (cb) cb(file);
             if (visited[file]) {
                 if (--pending === 0) output.queue(null);
@@ -132,10 +132,10 @@ module.exports = function (mains, opts) {
         nodeResolve(tr, params, function (err, res) {
             if (err) return cb(through());
             
-            if (!res) return output.emit('error', [
+            if (!res) return output.emit('error', new Error([
                 'cannot find transform module ', tr,
                 ' while transforming ', file
-            ].join(''));
+            ].join('')));
             cb(require(res)(file));
         });
     }
diff --git a/package.json b/package.json
index 6d5a1a6..2a95db3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "module-deps",
-    "version": "0.5.0",
+    "version": "0.5.1",
     "description": "walk the dependency graph to generate json output that can be fed into browser-pack",
     "main": "index.js",
     "bin": {

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



More information about the Pkg-javascript-commits mailing list