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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”() => MaybePromiseLike<T>
The function to run.
Returns
Section titled “Returns”Promise<T>
A promise settling the same way work would have, had its crash
been catchable normally.