@openocean.finance/widget-sdk
Version:
OpenOcean Any-to-Any Cross-Chain-Swap SDK
21 lines • 755 B
JavaScript
import { version } from '../version.js';
// Note: SDKError is used to wrapper and present errors at the top level
// Where opportunity allows we also add the step and the process related to the error
export class SDKError extends Error {
step;
process;
code;
name = 'SDKError';
cause;
constructor(cause, step, process) {
const errorMessage = `${cause.message ? `[${cause.name}] ${cause.message}` : 'Unknown error occurred'}\nOpenOcean SDK version: ${version}`;
super(errorMessage);
this.name = 'SDKError';
this.step = step;
this.process = process;
this.cause = cause;
this.stack = this.cause.stack;
this.code = cause.code;
}
}
//# sourceMappingURL=SDKError.js.map