[Pkg-javascript-commits] [node-module-deps] 332/444: better error message for invalid transforms

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:10 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 7657fcf0c8a541581e1fc7dd24f6fc68d9dd62a2
Author: James Halliday <mail at substack.net>
Date:   Thu Jan 1 17:18:32 2015 -0800

    better error message for invalid transforms
---
 index.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 254577d..9ae6d31 100644
--- a/index.js
+++ b/index.js
@@ -258,7 +258,11 @@ Deps.prototype.getTransforms = function (file, pkg, opts) {
             
             var r = require(res);
             if (typeof r !== 'function') {
-                return cb(new Error('transform not a function'));
+                return cb(new Error(
+                    'Unexpected ' + typeof r + ' exported by the '
+                    + JSON.stringify(res) + ' package. '
+                    + 'Expected a transform function.'
+                ));
             }
             
             var trs = r(file, trOpts);

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