@atomicfinance/errors 3.5.3 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/lib/index.js +0 -64
package/package.json
CHANGED
package/lib/index.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InsufficientBalanceError = exports.InvalidExpirationError = exports.InvalidAddressError = exports.InvalidSecretError = exports.NodeError = exports.WalletError = exports.InvalidDestinationAddressError = exports.BlockNotFoundError = exports.TxFailedError = exports.TxNotFoundError = exports.PendingTxError = exports.InvalidProviderResponseError = exports.UnimplementedMethodError = exports.UnsupportedMethodError = exports.NoProviderError = exports.DuplicateProviderError = exports.InvalidProviderError = exports.ProviderNotFoundError = exports.StandardError = exports.BaseError = void 0;
|
|
4
|
-
class BaseError extends Error {
|
|
5
|
-
constructor(msg, props) {
|
|
6
|
-
super();
|
|
7
|
-
// Let all properties be enumerable for easier serialization.
|
|
8
|
-
if (msg && typeof msg === 'object') {
|
|
9
|
-
props = msg;
|
|
10
|
-
msg = undefined;
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
this.message = typeof msg === 'string' ? msg : '';
|
|
14
|
-
}
|
|
15
|
-
// Name has to be an own property (or on the prototype a single step up) for
|
|
16
|
-
// the stack to be printed with the correct name.
|
|
17
|
-
if (props) {
|
|
18
|
-
Object.assign(this, props);
|
|
19
|
-
}
|
|
20
|
-
if (!Object.prototype.hasOwnProperty.call(this, 'name')) {
|
|
21
|
-
this.name = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this), 'name')
|
|
22
|
-
? this.name
|
|
23
|
-
: this.constructor.name;
|
|
24
|
-
}
|
|
25
|
-
// Capture stack trace
|
|
26
|
-
if (Error.captureStackTrace) {
|
|
27
|
-
Error.captureStackTrace(this, this.constructor);
|
|
28
|
-
}
|
|
29
|
-
// Ensure 'name' property is not enumerable
|
|
30
|
-
Object.defineProperty(this, 'name', {
|
|
31
|
-
value: 'StandardError',
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true,
|
|
34
|
-
writable: true,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.BaseError = BaseError;
|
|
39
|
-
function createError(name) {
|
|
40
|
-
const Error = class extends BaseError {
|
|
41
|
-
};
|
|
42
|
-
Error.prototype.name = name;
|
|
43
|
-
return Error;
|
|
44
|
-
}
|
|
45
|
-
exports.StandardError = createError('StandardError');
|
|
46
|
-
exports.ProviderNotFoundError = createError('ProviderNotFoundError');
|
|
47
|
-
exports.InvalidProviderError = createError('InvalidProviderError');
|
|
48
|
-
exports.DuplicateProviderError = createError('DuplicateProviderError');
|
|
49
|
-
exports.NoProviderError = createError('NoProviderError');
|
|
50
|
-
exports.UnsupportedMethodError = createError('UnsupportedMethodError');
|
|
51
|
-
exports.UnimplementedMethodError = createError('UnimplementedMethodError');
|
|
52
|
-
exports.InvalidProviderResponseError = createError('InvalidProviderResponseError');
|
|
53
|
-
exports.PendingTxError = createError('PendingTxError');
|
|
54
|
-
exports.TxNotFoundError = createError('TxNotFoundError');
|
|
55
|
-
exports.TxFailedError = createError('TxFailedError');
|
|
56
|
-
exports.BlockNotFoundError = createError('BlockNotFoundError');
|
|
57
|
-
exports.InvalidDestinationAddressError = createError('InvalidDestinationAddressError');
|
|
58
|
-
exports.WalletError = createError('WalletError');
|
|
59
|
-
exports.NodeError = createError('NodeError');
|
|
60
|
-
exports.InvalidSecretError = createError('InvalidSecretError');
|
|
61
|
-
exports.InvalidAddressError = createError('InvalidAddressError');
|
|
62
|
-
exports.InvalidExpirationError = createError('InvalidExpirationError');
|
|
63
|
-
exports.InsufficientBalanceError = createError('InsufficientBalanceError');
|
|
64
|
-
//# sourceMappingURL=index.js.map
|