{"version":3,"file":"TracedError.mjs","sources":["../../../src/utils/TracedError.ts"],"sourcesContent":["/**\n * An Error that presents a custom, human-readable `message` while preserving the stack\n * trace of the original error (`cause`).\n *\n * Faro parses an exception's stack frames from the top-level error's `.stack`, and\n * serializes `.cause` only as a string (its message, not its stack). Wrapping with a plain\n * `new Error(message, { cause })` therefore reports the wrapper's shallow stack and drops the\n * original frames. Copying the cause's stack onto this error is what gets the real failure\n * location into telemetry under a descriptive title.\n */\nexport class TracedError extends Error {\n  constructor(message: string, cause: unknown) {\n    super(message, { cause });\n    this.name = 'TracedError';\n\n    if (cause instanceof Error && cause.stack) {\n      this.stack = cause.stack;\n    }\n  }\n}\n"],"names":[],"mappings":";AAUO,MAAM,oBAAoB,KAAA,CAAM;AAAA,EACrC,WAAA,CAAY,SAAiB,KAAA,EAAgB;AAC3C,IAAA,KAAA,CAAM,OAAA,EAAS,EAAE,KAAA,EAAO,CAAA;AACxB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAEZ,IAAA,IAAI,KAAA,YAAiB,KAAA,IAAS,KAAA,CAAM,KAAA,EAAO;AACzC,MAAA,IAAA,CAAK,QAAQ,KAAA,CAAM,KAAA;AAAA,IACrB;AAAA,EACF;AACF;;;;"}