In Nodejs, for every api i am using try/catch block, if everything works i return the response with 200 and in catch block i need to use the res.status(500).send()
is there any way i can avoid using try/catch like if anything fails, some middleware or anything can catch the error and send the error response to user.
Like in NestJS you just simply use the return response, no need to even use res.send to send the response, if there is error it automatically send the 500 response