UNPKG

@bithomp/xrpl-api

Version:

A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger

29 lines (28 loc) 820 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.XrplApiError = void 0; const util_1 = require("util"); const utils_1 = require("../utils"); class XrplApiError extends Error { constructor(message = "", data) { super(message); this.name = (0, utils_1.getConstructorName)(this); this.message = message; this.data = data; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } toString() { let result = `[${this.name}(${this.message}`; if (this.data) { result += `, ${(0, util_1.inspect)(this.data)}`; } result += ")]"; return result; } inspect() { return this.toString(); } } exports.XrplApiError = XrplApiError;