Skip to content

Commit 64ef317

Browse files
committed
Stats error reporting catches string errors. Some plugins appear to not obey the rules on error reporting. However this makes debuging a nightmare for users. Therefore the string should be allowed.
1 parent a45c7dd commit 64ef317

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎lib/Stats.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Stats.prototype.toJson = function toJson(options, forToString) {
7474
}
7575
function formatError(e) {
7676
var text = "";
77+
if(typeof e === "string")
78+
e = {message: e};
7779
if(e.module && e.module.readableIdentifier && typeof e.module.readableIdentifier === "function") {
7880
text += e.module.readableIdentifier(requestShortener) + "\n";
7981
} else if(e.file) {

0 commit comments

Comments
 (0)