Skip to content

Commit 18c3130

Browse files
committed
fix an issue with validation error formatting
1 parent bc4196c commit 18c3130

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎lib/WebpackOptionsValidationError.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ class WebpackOptionsValidationError extends Error {
5151
constructor(validationErrors) {
5252
super();
5353

54-
if(Error.hasOwnProperty("captureStackTrace")) {
55-
Error.captureStackTrace(this, this.constructor);
56-
}
5754
this.name = "WebpackOptionsValidationError";
5855

5956
this.message = "Invalid configuration object. " +
6057
"Webpack has been initialised using a configuration object that does not match the API schema.\n" +
6158
validationErrors.map(err => " - " + indent(WebpackOptionsValidationError.formatValidationError(err), " ", false)).join("\n");
6259
this.validationErrors = validationErrors;
60+
61+
if(Error.hasOwnProperty("captureStackTrace")) {
62+
Error.captureStackTrace(this, this.constructor);
63+
}
6364
}
6465

6566
static formatSchema(schema, prevSchemas) {

0 commit comments

Comments
 (0)