aboutsummaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/ModuleError.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webpack/lib/ModuleError.js')
-rw-r--r--node_modules/webpack/lib/ModuleError.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/webpack/lib/ModuleError.js b/node_modules/webpack/lib/ModuleError.js
new file mode 100644
index 000000000..9e9be7683
--- /dev/null
+++ b/node_modules/webpack/lib/ModuleError.js
@@ -0,0 +1,24 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+"use strict";
+
+const WebpackError = require("./WebpackError");
+const cleanUp = require("./ErrorHelpers").cleanUp;
+
+class ModuleError extends WebpackError {
+ constructor(module, err) {
+ super();
+
+ this.name = "ModuleError";
+ this.module = module;
+ this.message = err && typeof err === "object" && err.message ? err.message : err;
+ this.error = err;
+ this.details = err && typeof err === "object" && err.stack ? cleanUp(err.stack, this.message) : undefined;
+
+ Error.captureStackTrace(this, this.constructor);
+ }
+}
+
+module.exports = ModuleError;