[Pkg-javascript-commits] [node-module-deps] 132/444: better error messages for readFile errors

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:49 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 c89c77862a0c3880ac09de8ed529a92a7f7026fc
Author: James Halliday <mail at substack.net>
Date:   Thu Aug 15 14:48:15 2013 -0700

    better error messages for readFile errors
---
 index.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 0cacaea..f34d13d 100644
--- a/index.js
+++ b/index.js
@@ -108,7 +108,16 @@ module.exports = function (mains, opts) {
                 parseDeps(file, cache[file], pkg);
             }
             else fs.readFile(file, 'utf8', function (err, src) {
-                if (err) return output.emit('error', err);
+                if (err) {
+                    var e = new Error(
+                        err.message
+                        + ' while resolving '
+                        + JSON.stringify(id)
+                        + ' from file '
+                        + parent.filename
+                    );
+                    return output.emit('error', e);
+                }
                 applyTransforms(file, trx, src, pkg);
             });
         });

-- 
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