backtrace-node
Version:
Backtrace error reporting tool
120 lines (119 loc) • 3.8 kB
TypeScript
import { IBacktraceData } from './backtraceData';
import { BacktraceStackTrace } from './backtraceStackTrace';
/**
* BacktraceReport describe current exception/message payload message to Backtrace
*/
export declare class BacktraceReport {
private data;
private clientAttributes;
private attachments;
static machineId: string;
set symbolication(symbolication: boolean);
set symbolicationMap(symbolMap: Array<{
file: string;
uuid: string;
}>);
readonly uuid: string;
readonly timestamp: number;
readonly lang = "nodejs";
readonly langVersion: string;
readonly agent = "backtrace-node";
readonly agentVersion = "1.2.0";
readonly mainThread = "main";
classifiers: string[];
/**
* @deprecated
* Please use client.sendReport instead
* BacktraceReport generated by library allows you to
* automatically send reports to Backtrace via send method
*/
send?: (callback: (err?: Error) => void) => void;
/**
* @deprecated
* Please use client.sendReport instead
* BacktraceReport generated by library allows you to
* automatically send reports to Backtrace via send method
*/
sendSync?: (callback: (err?: Error) => void) => void;
/**
* Thread information about current application
*/
stackTrace: BacktraceStackTrace;
private _symbolicationMap?;
private _symbolication;
/**
* Current report attributes
*/
private attributes;
/**
* Backtrace complex objet
*/
private annotations;
/**
* Calling module information
*/
private _callingModule;
private _callingModulePath;
private tabWidth;
private contextLineCount;
private err;
/**
* Create new BacktraceReport - report information that will collect information
* for Backtrace.
*
* Possible existing scenarios:
* arg1: error + arg2: attributes = all required
* arg1: object, arg2: nothing
*
* @param err Error or message - content to report
* @param attributes Report attributes dictionary
* @param attachments Report attachments that Backtrace will send to API
*/
constructor(data?: Error | string, clientAttributes?: {
[index: string]: any;
}, attachments?: string[]);
/**
* Check if report contains exception information
*/
isExceptionTypeReport(): boolean;
getPayload(): Error | string;
/**
* Set error or message in BacktraceReport object
* @param err Current error
*/
setError(err: Error | string): void;
/**
* @deprecated
* Please don't use log method in new BacktraceReport object.
*/
log(): void;
/**
* @deprecated
* Please don't use trace method in new BacktraceReport object
*/
trace(): void;
/**
* Add new attributes to existing report attributes
* @param attributes new report attributes object
*/
addObjectAttributes(attributes: {
[index: string]: any;
}): void;
addAttribute(key: string, value: any): void;
addAnnotation(key: string, value: object): void;
getAttachments(): string[];
toJson(): Promise<IBacktraceData>;
setSourceCodeOptions(tabWidth: number, contextLineCount: number): void;
/**
* Include symbolication information based on stack trace analysis
*/
private includeSymbolication;
private collectReportInformation;
private readBuiltInAttributes;
private detectReportType;
private generateUuid;
private readErrorAttributes;
private readAttributes;
private readAnnotation;
private splitAttributesFromAnnotations;
}