Error Management in Node.js Applications

Microservices with NodeJS — Part 2

Deepal Jayasekara
Published in
7 min readMay 27, 2019

--

This is the second article of a series focused on building a Microservice architecture with NodeJS. You can access the rest of the articles on the series below:

“Error Management” is a weird title. But I meant it. Error handling is a common topic which everyone talks about and writes about. Error handling in NodeJS? you’ll find loads of articles written about error handling in NodeJS. There’s a reason for that. Most of the developers who are new to the asynchronous programming in Node.js often get confused about how to handle different types of errors properly. try…catch doesn’t always come into rescue if you are in asynchronous programming. I also have listed some of the best practices of handling synchronous and asynchronous errors in Node.js in one of my previous articles about developing secure Node.js applications. And there comes a ‘but’.

Assuming you have handled your application errors correctly, and you successfully caught an error. The next most important part…

--

--

Staff Engineer, Interested in Cyber Security, Distributed Systems and Networking