UNPKG

1.44 kBTypeScriptView Raw
1import type { NodeClient } from '../sdk/client';
2interface OnUncaughtExceptionOptions {
3 /**
4 * Controls if the SDK should register a handler to exit the process on uncaught errors:
5 * - `true`: The SDK will exit the process on all uncaught errors.
6 * - `false`: The SDK will only exit the process when there are no other `uncaughtException` handlers attached.
7 *
8 * Default: `false`
9 */
10 exitEvenIfOtherHandlersAreRegistered: boolean;
11 /**
12 * This is called when an uncaught error would cause the process to exit.
13 *
14 * @param firstError Uncaught error causing the process to exit
15 * @param secondError Will be set if the handler was called multiple times. This can happen either because
16 * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`
17 * was running.
18 */
19 onFatalError?(this: void, firstError: Error, secondError?: Error): void;
20}
21/**
22 * Add a global exception handler.
23 */
24export declare const onUncaughtExceptionIntegration: (options?: Partial<OnUncaughtExceptionOptions> | undefined) => import("@sentry/core").Integration;
25type ErrorHandler = {
26 _errorHandler: boolean;
27} & ((error: Error) => void);
28/** Exported only for tests */
29export declare function makeErrorHandler(client: NodeClient, options: OnUncaughtExceptionOptions): ErrorHandler;
30export {};
31//# sourceMappingURL=onuncaughtexception.d.ts.map
\No newline at end of file