Skip to content

Type Alias: ErrorHandler()

ts
type ErrorHandler = (error: any) => Promise<any>;

Error handler called when any middleware in the pipeline raises an exception.

When defined, errors are caught and passed to this handler instead of bubbling up to the run method. This allows you to implement custom error handling logic and optionally resume the downstream flow of middleware.

Parameters

ParameterTypeDescription
erroranyThe error thrown by the middleware

Returns

Promise<any>