My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you handle errors in Node.js server code?

Suman Kundu's photo
Suman Kundu
·Jan 18, 2019

Currently, I'm working with a large codebase. The codebase is split into different services and each service has its own controller. Now the controller is interacting with the outside world. From this what I have gathered is the error should be handled only in the controller functions.

I am not sure if this is the best approach or not but seems usable.