hiteshchoudhary / chai-backend

A video series on chai aur code youtube channel
4.69k stars 697 forks source link

Added error handling middleware in app.js to handle error thrown by `asyncHandler` in `ApiError` 's Object. #105

Open HarshGaur387R opened 5 months ago

HarshGaur387R commented 5 months ago

Added error handling middleware in app.js to handle error thrown by asyncHandler in ApiError 's Object. The middleware responsible for error handling is conspicuously absent from both the tutorial and the source code. Despite its critical role, this component remains unaddressed. I resolved this issue by adding error handling middleware at the end of all routes in the app.js file.