CodeZettaInterview Hub

NestJS · Exception Filters · Junior · Architecture

HttpException vs domain errors — mapping strategy?

Short Interview Answer

Throw domain errors in services; filter maps to HttpException/status codes at the edge.

Detailed Explanation

Avoid leaking ORM errors. Preserve cause for logs. Don't catch in every controller.

Did you know this answer?