UNPKG

1.01 kBTypeScriptView Raw
1import { Integration } from '@sentry/types';
2declare type UnhandledRejectionMode = 'none' | 'warn' | 'strict';
3/** Global Promise Rejection handler */
4export declare class OnUnhandledRejection implements Integration {
5 private readonly _options;
6 /**
7 * @inheritDoc
8 */
9 static id: string;
10 /**
11 * @inheritDoc
12 */
13 name: string;
14 /**
15 * @inheritDoc
16 */
17 constructor(_options?: {
18 /**
19 * Option deciding what to do after capturing unhandledRejection,
20 * that mimicks behavior of node's --unhandled-rejection flag.
21 */
22 mode: UnhandledRejectionMode;
23 });
24 /**
25 * @inheritDoc
26 */
27 setupOnce(): void;
28 /**
29 * Send an exception with reason
30 * @param reason string
31 * @param promise promise
32 */
33 sendUnhandledPromise(reason: any, promise: any): void;
34 /**
35 * Handler for `mode` option
36 */
37 private _handleRejection;
38}
39export {};
40//# sourceMappingURL=onunhandledrejection.d.ts.map
\No newline at end of file