Skip to content

Commit fd4599d

Browse files
authored
fix: show error stack trace for debugging (#53)
1 parent 20ebe58 commit fd4599d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/errors.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
// @ts-nocheck
2-
"use strict";
2+
'use strict';
33

44
module.exports = function (err) {
55
return {
66
toHtml: function () {
7-
return "[html-rspack-plugin]:\n<pre>\n" + this.toString() + "</pre>";
7+
return '[html-rspack-plugin]:\n<pre>\n' + this.toString() + '</pre>';
88
},
99
toJsonHtml: function () {
1010
return JSON.stringify(this.toHtml());
1111
},
1212
toString: function () {
1313
if (err.message) {
14-
return `[html-rspack-plugin]: ` + err.message;
14+
return (
15+
`[html-rspack-plugin]: ` +
16+
(err.stack || `${err.name}: ${err.message}`)
17+
);
1518
}
1619
return err;
17-
}
20+
},
1821
};
1922
};

0 commit comments

Comments
 (0)