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.7 KB
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Jarid Margolin @jaridmargolin
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | const inspect = require("util").inspect.custom;
|
---|
9 | const makeSerializable = require("./util/makeSerializable");
|
---|
10 |
|
---|
11 | /** @typedef {import("./Chunk")} Chunk */
|
---|
12 | /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
---|
13 | /** @typedef {import("./Module")} Module */
|
---|
14 | /** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
---|
15 | /** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
---|
16 |
|
---|
17 | class WebpackError extends Error {
|
---|
18 | /**
|
---|
19 | * Creates an instance of WebpackError.
|
---|
20 | * @param {string=} message error message
|
---|
21 | */
|
---|
22 | constructor(message) {
|
---|
23 | super(message);
|
---|
24 |
|
---|
25 | /** @type {string=} */
|
---|
26 | this.details = undefined;
|
---|
27 | /** @type {(Module | null)=} */
|
---|
28 | this.module = undefined;
|
---|
29 | /** @type {DependencyLocation=} */
|
---|
30 | this.loc = undefined;
|
---|
31 | /** @type {boolean=} */
|
---|
32 | this.hideStack = undefined;
|
---|
33 | /** @type {Chunk=} */
|
---|
34 | this.chunk = undefined;
|
---|
35 | /** @type {string=} */
|
---|
36 | this.file = undefined;
|
---|
37 | }
|
---|
38 |
|
---|
39 | [inspect]() {
|
---|
40 | return this.stack + (this.details ? `\n${this.details}` : "");
|
---|
41 | }
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * @param {ObjectSerializerContext} context context
|
---|
45 | */
|
---|
46 | serialize({ write }) {
|
---|
47 | write(this.name);
|
---|
48 | write(this.message);
|
---|
49 | write(this.stack);
|
---|
50 | write(this.details);
|
---|
51 | write(this.loc);
|
---|
52 | write(this.hideStack);
|
---|
53 | }
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * @param {ObjectDeserializerContext} context context
|
---|
57 | */
|
---|
58 | deserialize({ read }) {
|
---|
59 | this.name = read();
|
---|
60 | this.message = read();
|
---|
61 | this.stack = read();
|
---|
62 | this.details = read();
|
---|
63 | this.loc = read();
|
---|
64 | this.hideStack = read();
|
---|
65 | }
|
---|
66 | }
|
---|
67 |
|
---|
68 | makeSerializable(WebpackError, "webpack/lib/WebpackError");
|
---|
69 |
|
---|
70 | module.exports = WebpackError;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.