UNPKG

2.26 kBTypeScriptView Raw
1/**
2 * Metadata about a captured exception, intended to provide a hint as to the means by which it was captured.
3 */
4export interface Mechanism {
5 /**
6 * For now, restricted to `onerror`, `onunhandledrejection` (both obvious), `instrument` (the result of
7 * auto-instrumentation), and `generic` (everything else). Converted to a tag on ingest.
8 */
9 type: string;
10 /**
11 * In theory, whether or not the exception has been handled by the user. In practice, whether or not we see it before
12 * it hits the global error/rejection handlers, whether through explicit handling by the user or auto instrumentation.
13 * Converted to a tag on ingest and used in various ways in the UI.
14 */
15 handled?: boolean;
16 /**
17 * Arbitrary data to be associated with the mechanism (for example, errors coming from event handlers include the
18 * handler name and the event target. Will show up in the UI directly above the stacktrace.
19 */
20 data?: {
21 [key: string]: string | boolean;
22 };
23 /**
24 * True when `captureException` is called with anything other than an instance of `Error` (or, in the case of browser,
25 * an instance of `ErrorEvent`, `DOMError`, or `DOMException`). causing us to create a synthetic error in an attempt
26 * to recreate the stacktrace.
27 */
28 synthetic?: boolean;
29 /**
30 * Describes the source of the exception, in the case that this is a derived (linked or aggregate) error.
31 *
32 * This should be populated with the name of the property where the exception was found on the parent exception.
33 * E.g. "cause", "errors[0]", "errors[1]"
34 */
35 source?: string;
36 /**
37 * Indicates whether the exception is an `AggregateException`.
38 */
39 is_exception_group?: boolean;
40 /**
41 * An identifier for the exception inside the `event.exception.values` array. This identifier is referenced to via the
42 * `parent_id` attribute to link and aggregate errors.
43 */
44 exception_id?: number;
45 /**
46 * References another exception via the `exception_id` field to indicate that this exception is a child of that
47 * exception in the case of aggregate or linked errors.
48 */
49 parent_id?: number;
50}
51//# sourceMappingURL=mechanism.d.ts.map
\No newline at end of file