Handling Errors
Last updated
Was this helpful?
Last updated
Was this helpful?
Each controller method call is wrapped in a HOF (higher-order function) called use
.
This is a middleware function that catches any errors in the controller methods and then passes these to a global error handler. This prevents you from having to use try...catch
in your application.
Errors are handled inside /server.js
When an error is caught, it will be logged to the console and a 500 status message returned to the client along with the error message.
Please refer to the error handling section in or to understand how these errors are handled on the client side.