import type { Collector, TelescopeStorage } from '../types.js'; /** * Records exceptions by wrapping the global exception reporter. * * **Load-bearing: this collector must swallow its own errors.** The * exception reporter sits in the framework's error handling path. If * `record()` throws — say, because storage is unhealthy — the framework's * error handler calls `report()` on *that* failure, which re-enters this * wrapper, which fails again, which reports again, ad infinitum. The * `_recording` re-entry guard plus the try/catch around `record()` and * `previousReport()` collectively break the cycle. * * `previousReport` MUST be the reporter installed before us — the return * value of `setExceptionReporter`. Capturing `report` instead forwards to * whatever the current reporter is (this wrapper), so the chain to the real * previous reporter (e.g. the log channel) is never reached and exceptions * are silently swallowed instead of forwarded. * * If you refactor this class, preserve all three: the re-entry guard, the * record-call try/catch, and the previous-reporter try/catch. None of * them are defensive coding for hypothetical bugs — each blocks a real * cascade path that has bitten us before. */ export declare class ExceptionCollector implements Collector { private readonly storage; readonly name = "Exception Collector"; readonly type: "exception"; private _recording; constructor(storage: TelescopeStorage); register(): Promise; private record; } //# sourceMappingURL=exception.d.ts.map