1 |
class WarehouseError extends Error { |
1✔ |
2 |
code?: string;
|
1✔ |
3 |
|
1✔ |
4 |
/**
|
1✔ |
5 |
* WarehouseError constructor |
1✔ |
6 |
* |
1✔ |
7 |
* @param {string} msg |
1✔ |
8 |
* @param {string} code |
1✔ |
9 |
*/ |
1✔ |
10 |
constructor(msg: string, code?: string) { |
|
11 |
super(msg); |
60✔ |
12 |
|
60✔ |
13 |
Error.captureStackTrace(this);
|
60✔ |
14 |
|
60✔ |
15 |
this.code = code;
|
60✔ |
16 |
} |
60✔ |
17 |
static ID_EXIST = 'ID_EXIST'; |
1✔ |
18 |
static ID_NOT_EXIST = 'ID_NOT_EXIST'; |
1✔ |
19 |
static ID_UNDEFINED = 'ID_UNDEFINED'; |
1✔ |
20 |
} |
1✔ |
21 |
|
1✔ |
22 |
WarehouseError.prototype.name = 'WarehouseError'; |
1✔ |
23 |
|
1✔ |
24 |
export default WarehouseError; |
1✔ |