import assert from "node:assert" ; import { ReadonlyDeep , } from "type-fest" ; export default class WrappedError extends Error { constructor ( public readonly innerError , message ) { super ( message ) ; assert ( this . innerError instanceof Error ) ; } override toString ( ) { return `${ super . toString ( ) } (${ JSON . stringify ( String ( this . innerError ) ) })` ; } }