1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class AccountsError extends Error {
|
4 | constructor(packageName, functionName, reason) {
|
5 |
|
6 | const message = reason
|
7 | ? `[ Accounts - ${packageName} ] ${functionName} : ${reason}`
|
8 | : packageName;
|
9 |
|
10 | super(message);
|
11 |
|
12 | this.packageName = packageName;
|
13 | this.functionName = functionName;
|
14 | this.reason = reason;
|
15 |
|
16 | Object.setPrototypeOf(this, AccountsError.prototype);
|
17 |
|
18 | if (typeof Error.captureStackTrace === 'function') {
|
19 | Error.captureStackTrace(this, this.constructor);
|
20 | }
|
21 | else {
|
22 | this.stack = new Error(message).stack;
|
23 | }
|
24 | }
|
25 | }
|
26 | exports.default = AccountsError;
|
27 |
|
\ | No newline at end of file |