Concept Flow - Error-handling middleware
Request received
Route handler runs
Error occurs?
No→Send response
Yes
Pass error to next()
Error-handling middleware runs
Send error response
End request
When a request causes an error, Express passes it to special middleware with 4 parameters to handle and respond with error info.
