ExpressErrorCallbackFunction
ExpressErrorCallbackFunction = (
params) =>void|Promise<void>
Callback called when an unhandled error is thrown inside an AdminForth API endpoint handler. Useful to report errors to external services (e.g. Sentry) or to do custom logging. Thrown errors / rejections from this callback are caught and logged, they do not affect the response.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { adminforth: IAdminForth; error: any; extra: HttpExtra; } | - |
params.adminforth | IAdminForth | Adminforth instance. |
params.error | any | The error thrown by the endpoint handler. |
params.extra | HttpExtra | Extra HTTP information about the request which caused the error. |
Returns
void | Promise<void>