Skip to content

Commit

Permalink
fix: Catch and ignore pretty-error errors
Browse files Browse the repository at this point in the history
Fixes #921
  • Loading branch information
aaronjensen authored and jantimon committed Oct 15, 2018
1 parent bb17284 commit 2056139
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/errors.js
Expand Up @@ -18,7 +18,14 @@ module.exports = function (err, context) {
return JSON.stringify(this.toHtml());
},
toString: function () {
return prettyError.render(err).replace(/webpack:\/\/\/\./g, context);
try {
return prettyError.render(err).replace(/webpack:\/\/\/\./g, context);
} catch (e) {
// This can sometimes fail. We don't know why, but returning the
// original error is better than returning the error thrown by
// pretty-error.
return err;
}
}
};
};

0 comments on commit 2056139

Please sign in to comment.