/** * Cause-chain capture: walks `Error.cause` (and `AggregateError.errors`) so a * wrapped error ships with the underlying root cause, the way Sentry's * linkedErrors integration does. * * Adapted from sentry-javascript (packages/core/src/utils/aggregate-errors.ts), * MIT License, Copyright (c) 2019-present Functional Software, Inc. dba Sentry. * * Pure and dependency-free; covered by __tests__/linked-errors.test.ts. */ import { StackFrame } from './stack-parser'; export interface LinkedException { exceptionType: string; value: string; stackFrames: StackFrame[]; /** How this exception is linked to its parent: 'cause' or 'errors[i]'. */ source: string; } /** * Collect the chain of linked exceptions hanging off a thrown value, in * outermost-cause-first order. Cycle-safe and bounded by `limit`. Returns [] * for non-Error values or errors with no cause. */ export declare function collectLinkedErrors(error: unknown, limit?: number): LinkedException[]; //# sourceMappingURL=linked-errors.d.ts.map