UNPKG

@atomiqlabs/sdk

Version:

atomiq labs SDK for cross-chain swaps between smart chains and bitcoin

28 lines (27 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IntermediaryError = void 0; /** * An error or inconsistency in the intermediary's returned data, this will blacklist the intermediary * * @category Errors */ class IntermediaryError extends Error { constructor(msg, originalError, recoverable = false) { if (originalError != null) { if (originalError.name != null) msg += ": " + originalError.name; if (originalError.message != null) msg += ": " + originalError.message; if (typeof (originalError) === "string") msg += ": " + originalError; } super(msg); if (originalError?.stack != null) this.originalStack = originalError.stack; this.recoverable = recoverable; // Set the prototype explicitly. Object.setPrototypeOf(this, IntermediaryError.prototype); } } exports.IntermediaryError = IntermediaryError;