UNPKG

1.39 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//# sourceMappingURL=mechanism.d.ts.map
\No newline at end of file