UNPKG

@backtrace/sdk-core

Version:
52 lines (51 loc) 1.65 kB
import { BacktraceAttachment } from '../attachment/index.js'; import { BacktraceStackFrame } from '../data/BacktraceStackTrace.js'; import { BacktraceReportStackTraceInfo } from './BacktraceReportStackTraceInfo.js'; export declare class BacktraceReport { readonly data: Error | string; readonly attributes: Record<string, unknown>; readonly attachments: BacktraceAttachment[]; /** * Report classifiers */ readonly classifiers: string[]; /** * Report annotations */ readonly annotations: Record<string, object>; /** * Report stack trace */ readonly stackTrace: Record<string, BacktraceReportStackTraceInfo | BacktraceStackFrame[]>; /** * Report message */ readonly message: string; /** * Report inner errors */ readonly innerReport: unknown[]; /** * Report timestamp in ms */ readonly timestamp: number; /** * Sets how many top frames should be skipped. */ skipFrames: number; /** * Add additional stack trace to the report. * If the thread name already exists it will be overwritten * @param name thread name * @param stack stack trace * @param message error message */ addStackTrace(name: string, stack: string, message?: string): this; addStackTrace(name: string, stackFrames: BacktraceStackFrame[]): this; constructor(data: Error | string, attributes?: Record<string, unknown>, attachments?: BacktraceAttachment[], options?: { skipFrames?: number; classifiers?: string[]; timestamp?: number; }); private generateErrorMessage; }