import { toError } from "./record_exception.mjs"; import { Span } from "@opentelemetry/api"; //#region src/exception_reporter.d.ts /** * Symbol stamped on Error objects after their first report * to prevent the same exception from being emitted as multiple * LogRecords when it propagates through nested record()/catch layers. */ declare const REPORTED_SYMBOL: unique symbol; interface ReportExceptionOptions { span?: Span; error: unknown; shouldReport: boolean; contextLines?: number; extraAttributes?: Record; } /** * Reports exceptions as OpenTelemetry LogRecords. * * When a span is provided, it is also marked with ERROR status * per the OTEL recording-errors spec. */ declare class ExceptionReporter { #private; /** * Report an exception as a LogRecord with source context frames. */ report(options: ReportExceptionOptions): Promise; /** * Synchronous version of report. Uses buildCauseChain (no file I/O) * so source context frames won't be available, but the full stack trace, * cause chain, error status, and exception event are still recorded. */ reportSync(options: ReportExceptionOptions): void; } //#endregion export { ExceptionReporter, REPORTED_SYMBOL, ReportExceptionOptions };