1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | "use strict";
|
7 |
|
8 | const WebpackError = require("./WebpackError");
|
9 |
|
10 |
|
11 |
|
12 | class ModuleRestoreError extends WebpackError {
|
13 | |
14 |
|
15 |
|
16 |
|
17 | constructor(module, err) {
|
18 | let message = "Module restore failed: ";
|
19 | let details = undefined;
|
20 | if (err !== null && typeof err === "object") {
|
21 | if (typeof err.stack === "string" && err.stack) {
|
22 | const stack = err.stack;
|
23 | message += stack;
|
24 | } else if (typeof err.message === "string" && err.message) {
|
25 | message += err.message;
|
26 | } else {
|
27 | message += err;
|
28 | }
|
29 | } else {
|
30 | message += String(err);
|
31 | }
|
32 |
|
33 | super(message);
|
34 |
|
35 | this.name = "ModuleRestoreError";
|
36 | this.details = details;
|
37 | this.module = module;
|
38 | this.error = err;
|
39 | }
|
40 | }
|
41 |
|
42 | module.exports = ModuleRestoreError;
|