Skip to content

catchOutOfBandApply

catchOutOfBandApply<A, R>(func, args): R | undefined

Defined in: packages/core/src/function/no-throw.ts:18

Calls a function, containing any error it throws — the error still surfaces, out of band (via queueMicrotask), instead of propagating to this call’s caller.

Note: this does not handle promise rejections. For async functions, use catchOutOfBandApplyAsync.

A extends unknown[]

R

Callable<A, R>

The function to call.

A

Arguments to pass to it.

R | undefined

The function’s result, or undefined if it threw.