Skip to content

rejectOnUncaught

rejectOnUncaught<T>(work): Promise<T>

Defined in: packages/node/src/process/guarded.ts:12

Runs work, converting a process-level crash (a synchronous throw outside any promise chain — a stray socket/timer callback, for instance) into a rejection of the returned promise instead of letting it kill the process.

T

() => MaybePromiseLike<T>

The function to run.

Promise<T>

A promise settling the same way work would have, had its crash been catchable normally.