Please enable JavaScript.
Coggle requires JavaScript to display documents.
Express: Error Handling - Coggle Diagram
Express: Error Handling
Introduction
what is it
returning
error
to client
ensuring express app lives on
motivation
catch() on most fetch libraries
so that client can catch it nicely
what it returns
error code 500
error data passed on next()/thrown
Sync Error Handling
key takeaways
no need to call
next()
throw new Error() immediately
Async Error Handling
how it works
call next() at error
the default middleware will catch it
how to get the error
try catch
pass next() at catch
Custom Error Handler