Popii - v0.5.1
    Preparing search index...

    Type Alias PopiiErrorMiddleware<TState, TInput, TLocals>

    PopiiErrorMiddleware: (
        err: any,
        pop: Pop<TState, TInput, TLocals>,
        next: (err?: any) => Promise<void> | void,
    ) => Promise<void> | void

    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

    • TState = any
    • TInput = any
    • TLocals = PopiiLocals & Record<string, any>

    Type Declaration

      • (
            err: any,
            pop: Pop<TState, TInput, TLocals>,
            next: (err?: any) => Promise<void> | void,
        ): Promise<void> | void
      • Parameters

        Returns Promise<void> | void