Documents / @faasjs/react / OnError
Type Alias: OnError
OnError = (
action,params) => (res) =>Promise<void>
Factory for per-request error handlers used by FaasReactClient.
The first call receives the action path and params that failed. It must return
an async callback that receives the ResponseError. faas rejects
after the callback resolves, or with the callback's thrown error; useFaas
stores the handled error in hook state unless the callback throws a replacement
error.
Parameters
action
string
Action path that failed.
params
Record<string, any>
Params sent with the failed request.
Returns
Async callback invoked with the resulting ResponseError.
(res) => Promise<void>