|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| 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("../Dependency").DependencyLocation} DependencyLocation */
|
|---|
| 11 | /** @typedef {import("../Module")} Module */
|
|---|
| 12 | /** @typedef {import("./ModuleBuildError").ErrorWithHideStack} ErrorWithHideStack */
|
|---|
| 13 |
|
|---|
| 14 | class ModuleDependencyError extends WebpackError {
|
|---|
| 15 | /**
|
|---|
| 16 | * Creates an instance of ModuleDependencyError.
|
|---|
| 17 | * @param {Module} module module tied to dependency
|
|---|
| 18 | * @param {ErrorWithHideStack} err error thrown
|
|---|
| 19 | * @param {DependencyLocation} loc location of dependency
|
|---|
| 20 | */
|
|---|
| 21 | constructor(module, err, loc) {
|
|---|
| 22 | super(err.message);
|
|---|
| 23 |
|
|---|
| 24 | /** @type {string} */
|
|---|
| 25 | this.name = "ModuleDependencyError";
|
|---|
| 26 | this.details =
|
|---|
| 27 | err && !err.hideStack
|
|---|
| 28 | ? /** @type {string} */ (err.stack).split("\n").slice(1).join("\n")
|
|---|
| 29 | : undefined;
|
|---|
| 30 | this.module = module;
|
|---|
| 31 | this.loc = loc;
|
|---|
| 32 | /** error is not (de)serialized, so it might be undefined after deserialization */
|
|---|
| 33 | this.error = err;
|
|---|
| 34 |
|
|---|
| 35 | if (err && err.hideStack && err.stack) {
|
|---|
| 36 | this.stack = /** @type {string} */ `${err.stack
|
|---|
| 37 | .split("\n")
|
|---|
| 38 | .slice(1)
|
|---|
| 39 | .join("\n")}\n\n${this.stack}`;
|
|---|
| 40 | }
|
|---|
| 41 | }
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | module.exports = ModuleDependencyError;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.