source: imaps-frontend/node_modules/webpack/lib/ModuleDependencyError.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

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