Error handling is an important part of any application. You don't always want the application to just crash. Sometimes you want to be a little more graceful than that. This is true of any app – web or otherwise – including Express apps. Fortunately, Express provides a rather unique and very powerful way of handling errors through its middleware features and routers.
In this episode, then, I'll show you how to properly handle errors in your routes and ensure they are forwarded to the right middleware error handler at the right time.