API reference / @backpack/error-handling / promises / onFailure
Function: onFailure()
ts
function onFailure(errorConsumer): (error) => never;
Executes the given callback if failed, letting the original error pass through.
Can be applied on the .catch()
method of a Promise
to introduce a side effect (such as logging the error).
Parameters
Parameter | Type |
---|---|
errorConsumer | (error ) => void |
Returns
ts
(error): never;
Parameters
Parameter | Type |
---|---|
error | unknown |
Returns
never