API reference / @chanx-js/server / core / ErrorHooks
Interface: ErrorHooks<Ctx>
Defined in: packages/server/src/consumer.ts:166
Overrides for how failures reach the client. Each defaults to what chanx does.
Extended by
Type Parameters
| Type Parameter |
|---|
Ctx |
Properties
onEventError?
ts
optional onEventError?: (error, event, ctx) => void | Promise<void>;Defined in: packages/server/src/consumer.ts:172
An event handler threw. Default: log it; the client is told nothing.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
event | Message |
ctx | Ctx |
Returns
void | Promise<void>
onHandlerError?
ts
optional onHandlerError?: (error, message, ctx) => void | Promise<void>;Defined in: packages/server/src/consumer.ts:170
A message handler threw. Default: log it, and an error frame naming the action.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
message | Message |
ctx | Ctx |
Returns
void | Promise<void>
onValidationError?
ts
optional onValidationError?: (issues, ctx) => void | Promise<void>;Defined in: packages/server/src/consumer.ts:168
A frame failed validation. Default: an error frame listing the issues.
Parameters
| Parameter | Type |
|---|---|
issues | ValidationIssue[] |
ctx | Ctx |
Returns
void | Promise<void>