UNPKG

nodejs-cryptomus

Version:

A comprehensive Node.js client for the Cryptomus API

17 lines (16 loc) 530 B
/** * Cryptomus API error */ export 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); } } }