-
Notifications
You must be signed in to change notification settings - Fork 0
exceptions in user defined functions
The MAP
, RECOVER
and SIDE_EFFECT
handlers support a callback which could itself throw. When this happens, that error is immediately thrown, short-circuiting the handler chain. Note that any error thrown from a TAP
callback is always suppressed.
⚠️ Keep your callbacks simple and unlikely to fail.
You can configure what should happen with the error thrown by the callback using the onCallbackError
option:
The error thrown by the callback is re-thrown as-is.
The error thrown by the callback is ignored and the triggering error is re-thrown instead (so you will get no indication that the callback failed).
The error thrown by the callback is wrapped in a SideEffectError
, MapError
, or RecoverError
depending on the action. This is the default.
Any exception thrown in a predicate
function is wrapped inside PredicateError
and thrown. This behaviour is not configurable.