UNPKG

476 BJavaScriptView Raw
1'use strict';
2
3class 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
20WarehouseError.prototype.name = 'WarehouseError';
21WarehouseError.ID_EXIST = 'ID_EXIST';
22WarehouseError.ID_NOT_EXIST = 'ID_NOT_EXIST';
23WarehouseError.ID_UNDEFINED = 'ID_UNDEFINED';
24
25module.exports = WarehouseError;