source: imaps-frontend/node_modules/webpack/lib/ModuleRestoreError.js

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
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const WebpackError = require("./WebpackError");
9
10/** @typedef {import("./Module")} Module */
11
12class 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 /** @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 = "ModuleRestoreError";
37 /** @type {string | undefined} */
38 this.details = details;
39 this.module = module;
40 this.error = err;
41 }
42}
43
44module.exports = ModuleRestoreError;
Note: See TracBrowser for help on using the repository browser.