| 8 | | 'rejectionHandled' |
| 9 | |
| 10 | export 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. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…