Will It Vibe logoWill It Vibe?
EXPRESS-005Low severity-4 points

No error-handling middleware

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

No four-argument (err, req, res, next) error middleware was found in an Express app, so thrown or forwarded errors hit the default handler with no consistent response shape.

Why it matters

Express only treats a middleware as an error handler when it has the four-argument (err, req, res, next) signature. With none present, errors passed to next(err) or thrown in sync code fall through to the built-in handler, which returns inconsistent responses and, with NODE_ENV unset, can include a stack trace. Centralized error handling is also where you log failures and shape a safe response.

How to fix it

Add a single error-handling middleware with the (err, req, res, next) signature after all routes. Log the real error server-side, then respond with a generic message and an appropriate status code, never the raw error. For async handlers, forward rejections to it (via a wrapper or express-async-errors) so they reach this middleware.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks