MCPcopy Create free account
hub / github.com/ehmicky/log-process-errors / Options

Interface Options

src/main.d.ts:10–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 | 'rejectionHandled'
9
10export interface Options {
11 /**
12 * Prevent exiting the process on
13 * [uncaught exceptions](https://nodejs.org/api/process.html#process_event_uncaughtexception)
14 * or
15 * [unhandled promises](https://nodejs.org/api/process.html#process_event_unhandledrejection).
16 *
17 * @default false
18 */
19 readonly exit?: boolean
20
21 /**
22 * Function called once per process error.
23 * Duplicate process errors are ignored.
24 *
25 * @default console.error(error)
26 *
27 * @example
28 * ```js
29 * // Log process errors with Winston instead
30 * logProcessErrors({
31 * onError(error, event) {
32 * winstonLogger.error(error.stack)
33 * },
34 * })
35 * ```
36 */
37 readonly onError?: (error: Error, event: Event) => Promise<void> | void
38}
39
40/**
41 * Restores Node.js default behavior.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…