CodeZettaInterview Hub

Node.js · Error Handling · Senior · Architecture

How do you model errors for APIs?

Short Interview Answer

Typed/error codes, HttpError hierarchy, cause chaining, and consistent client payloads without leaks.

Detailed Explanation

Include correlation IDs. Map validation vs auth vs internal. Don't expose stacks to clients.

Did you know this answer?