Skip to content

Commit 992f5c8

Browse files
committed
feat: throw error with validationErrors property
1 parent bebc397 commit 992f5c8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/webpack.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function webpack(options, callback) {
1818
} else if(typeof options === "object") {
1919
var webpackOptionsValidationErrors = validateWebpackOptions(options);
2020
if(webpackOptionsValidationErrors.length) {
21-
throw new Error("Passed 'options' object does not look like a valid webpack configuration");
21+
var validationError = new Error("Passed 'options' object does not look like a valid webpack configuration");
22+
validationError.validationErrors = webpackOptionsValidationErrors;
23+
throw validationError;
2224
}
2325
new WebpackOptionsDefaulter().process(options);
2426

0 commit comments

Comments
 (0)