UNPKG

@tristeroresearch/mach-sdk

Version:

A TypeScript SDK for integrating with Mach's API.

16 lines (15 loc) 407 B
import { getRootCause } from './utils/rootCause.js'; export class BaseError extends Error { code; cause; constructor(name, code, message, cause) { super(message); this.name = name; this.code = code; this.cause = cause; const rootCause = getRootCause(this.cause); if (rootCause?.stack) { this.stack = rootCause.stack; } } }