Skip to content

Commit 0114b3d

Browse files
committed
improved error reporting for optional dependencies
we don't want to annoy users with stack traces there
1 parent 47e3ae3 commit 0114b3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"use strict";
22

3-
let { repr } = require("faucet-pipeline/lib/util");
3+
let { abort, repr } = require("faucet-pipeline/lib/util");
44

55
let NOTIFY = '(typeof alert !== "undefined" ? alert : console.error)';
66

77
exports.requireOptional = function requireOptional(pkg, errorMessage, supplier = pkg) {
88
try {
99
return require(pkg);
1010
} catch(err) {
11-
throw new Error(`${errorMessage} - please install ${repr(supplier)}`);
11+
abort(`${errorMessage} - please install ${repr(supplier)}`);
1212
}
1313
};
1414

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"node": ">=6"
2727
},
2828
"dependencies": {
29-
"faucet-pipeline": "1.0.0-beta.1",
29+
"faucet-pipeline": "~1.0.0-beta.2",
3030
"mkdirp": "^0.5.1",
3131
"rollup": "^0.56.3",
3232
"rollup-plugin-commonjs": "^8.3.0",

0 commit comments

Comments
 (0)