PopiiErrorMiddleware
Popii / PopiiErrorMiddleware
Type Alias: PopiiErrorMiddleware<TState, TInput, TLocals>
Section titled “Type Alias: PopiiErrorMiddleware<TState, TInput, TLocals>”PopiiErrorMiddleware<
TState,TInput,TLocals> = (err,pop,next) =>Promise<void> |void
Defined in: types.ts:238
Error-handling middleware — receives the thrown error as the first argument. Popii detects error middlewares by arity (function.length === 3), matching the Express convention. Always declare all three parameters explicitly; do not use rest args or defaults that reduce arity.
Type Parameters
Section titled “Type Parameters”TState
Section titled “TState”TState = any
TInput
Section titled “TInput”TInput = any
TLocals
Section titled “TLocals”TLocals = PopiiLocals & Record<string, any>
Parameters
Section titled “Parameters”any
Pop<TState, TInput, TLocals>
(err?) => Promise<void> | void
Returns
Section titled “Returns”Promise<void> | void