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.
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.