Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
957 bytes
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Tobias Koppers @sokra
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | const WebpackError = require("./WebpackError");
|
---|
9 |
|
---|
10 | /** @typedef {import("./Module")} Module */
|
---|
11 |
|
---|
12 | class ModuleRestoreError extends WebpackError {
|
---|
13 | /**
|
---|
14 | * @param {Module} module module tied to dependency
|
---|
15 | * @param {string | Error} err error thrown
|
---|
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;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.