source: trip-planner-front/node_modules/webpack/lib/ModuleDependencyError.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[6a3a178]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 ? 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) {
34 this.stack =
35 err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack;
36 }
37 }
38}
39
40module.exports = ModuleDependencyError;
Note: See TracBrowser for help on using the repository browser.