1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | class BlueprintError extends Error {
|
13 | constructor (code, message, details) {
|
14 | super (message);
|
15 |
|
16 | if (typeof Error.captureStackTrace === 'function') {
|
17 | Error.captureStackTrace (this, this.constructor);
|
18 | }
|
19 | else {
|
20 | this.stack = (new Error(message)).stack;
|
21 | }
|
22 |
|
23 | this.name = this.constructor.name;
|
24 | this.code = code;
|
25 | this.message = message;
|
26 | this.details = details;
|
27 | }
|
28 |
|
29 | accept (v) {
|
30 | v.visitBlueprintError (this);
|
31 | }
|
32 | }
|
33 |
|
34 | module.exports = BlueprintError;
|