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