You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
5 years ago
|
/* eslint-disable no-magic-numbers */
|
||
|
function NodeError(message, statusCode) {
|
||
|
Error.captureStackTrace(this, this.constructor);
|
||
|
this.name = this.constructor.name;
|
||
|
this.message = message;
|
||
|
this.statusCode = statusCode;
|
||
|
}
|
||
|
require('util').inherits(NodeError, Error);
|
||
|
|
||
|
function BitcoindError(message, error, statusCode) {
|
||
|
Error.captureStackTrace(this, this.constructor);
|
||
|
this.name = this.constructor.name;
|
||
|
this.message = message;
|
||
|
this.error = error;
|
||
|
this.statusCode = statusCode;
|
||
|
}
|
||
|
require('util').inherits(BitcoindError, Error);
|
||
|
|
||
|
function LndError(message, error, statusCode) {
|
||
|
Error.captureStackTrace(this, this.constructor);
|
||
|
this.name = this.constructor.name;
|
||
|
this.message = message;
|
||
|
this.error = error;
|
||
|
this.statusCode = statusCode;
|
||
|
}
|
||
|
require('util').inherits(LndError, Error);
|
||
|
|
||
|
function ValidationError(message, statusCode) {
|
||
|
Error.captureStackTrace(this, this.constructor);
|
||
|
this.name = this.constructor.name;
|
||
|
this.message = message;
|
||
|
this.statusCode = statusCode || 400;
|
||
|
}
|
||
|
require('util').inherits(ValidationError, Error);
|
||
|
|
||
|
module.exports = {
|
||
|
NodeError,
|
||
|
BitcoindError,
|
||
|
LndError,
|
||
|
ValidationError
|
||
|
};
|
||
|
|