main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[79a0317] | 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 ModuleStoreError 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 storing failed: ";
|
---|
| 19 | /** @type {string | undefined} */
|
---|
| 20 | const details = undefined;
|
---|
| 21 | if (err !== null && typeof err === "object") {
|
---|
| 22 | if (typeof err.stack === "string" && err.stack) {
|
---|
| 23 | const stack = err.stack;
|
---|
| 24 | message += stack;
|
---|
| 25 | } else if (typeof err.message === "string" && err.message) {
|
---|
| 26 | message += err.message;
|
---|
| 27 | } else {
|
---|
| 28 | message += err;
|
---|
| 29 | }
|
---|
| 30 | } else {
|
---|
| 31 | message += String(err);
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | super(message);
|
---|
| 35 |
|
---|
| 36 | this.name = "ModuleStoreError";
|
---|
| 37 | this.details = /** @type {string | undefined} */ (details);
|
---|
| 38 | this.module = module;
|
---|
| 39 | this.error = err;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | module.exports = ModuleStoreError;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.