import { skipDevMessages } from './dev'; export class FlowfulError extends Error { cause?: unknown; constructor(message: string, cause?: any) { super(message); this.name = 'FlowfulError'; this.cause = cause; if (this.cause && !skipDevMessages()) { this.logCause(); } } logCause() { if (this.cause) { console.error(`${this.message} Caused by:`, this.cause); } return this; } }