DEV Community

Discussion on: Node.js best practices

Collapse
 
raftheunis87 profile image
Raf Theunis

Very interesting repository!

I was looking at the "Handle errors centrally. Not within middlewares" example. I do understand that it's better to handle errors within a dedicated object. But I found the given example to be incomplete? Say for example that I wrote an AppError class that extends from Error. If I throw this AppError in my application, how can I be sure that my dedicated error object will handle this?

Maybe a complete code example/gist could make this clearer for me.

Anyway, very nice repository! Keep up the great work!