nodejs-cryptomus
Version:
A comprehensive Node.js client for the Cryptomus API
21 lines (20 loc) • 674 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CryptomusError = void 0;
/**
* Cryptomus API error
*/
class CryptomusError extends Error {
constructor(message, errors, statusCode) {
super(message);
this.name = 'CryptomusError';
this.errors = errors;
this.statusCode = statusCode;
// Maintains proper stack trace for where our error was thrown
// Check if Error.captureStackTrace exists before calling it
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, CryptomusError);
}
}
}
exports.CryptomusError = CryptomusError;