mirror of
https://github.com/Retropex/umbrel-bitcoin.git
synced 2025-05-12 19:20:49 +02:00
33 lines
870 B
JavaScript
33 lines
870 B
JavaScript
/* 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 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,
|
|
ValidationError
|
|
};
|
|
|