Skip to content

Commit 27c440a

Browse files
authored
move captureStackTrace to the end of the constructor
1 parent 9388dd5 commit 27c440a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/ModuleParseError.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
class ModuleParseError extends Error {
88
constructor(module, source, err) {
99
super();
10-
if(Error.hasOwnProperty("captureStackTrace")) {
11-
Error.captureStackTrace(this, this.constructor);
12-
}
1310
this.name = "ModuleParseError";
1411
this.message = "Module parse failed: " + module.request + " " + err.message;
1512
this.message += "\nYou may need an appropriate loader to handle this file type.";
@@ -26,6 +23,9 @@ class ModuleParseError extends Error {
2623
}
2724
this.module = module;
2825
this.error = err;
26+
if(Error.hasOwnProperty("captureStackTrace")) {
27+
Error.captureStackTrace(this, this.constructor);
28+
}
2929
}
3030
}
3131

0 commit comments

Comments
 (0)