DEV Community

Discussion on: Bulletproof node.js project architecture 🛡️

Collapse
 
xayden profile image
Abdullah Gira

Or you can use express-async-error.

# terminal
npm -i express-async-error
Enter fullscreen mode Exit fullscreen mode
// index.js
require('express-async-error');
Enter fullscreen mode Exit fullscreen mode

and that's it, any error happens the express-async-error will catch it and passes it to the default express error handler.