Skip to content

Commit 2056139

Browse files
aaronjensenjantimon
authored andcommittedOct 15, 2018
fix: Catch and ignore pretty-error errors
Fixes #921
1 parent bb17284 commit 2056139

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎lib/errors.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ module.exports = function (err, context) {
1818
return JSON.stringify(this.toHtml());
1919
},
2020
toString: function () {
21-
return prettyError.render(err).replace(/webpack:\/\/\/\./g, context);
21+
try {
22+
return prettyError.render(err).replace(/webpack:\/\/\/\./g, context);
23+
} catch (e) {
24+
// This can sometimes fail. We don't know why, but returning the
25+
// original error is better than returning the error thrown by
26+
// pretty-error.
27+
return err;
28+
}
2229
}
2330
};
2431
};

0 commit comments

Comments
 (0)
Please sign in to comment.