Skip to main content

2 docs tagged with "error-handling"

View all tags

Error Handling — Mapping Domain Exceptions to HTTP Statuses

Explains error handling in a DDD architecture. Covers an exception hierarchy organized per aggregate, the design of DomainException, mapping to HTTP statuses (404/409/422, etc.) in the Exception Handler, a unified error response, the Result type pattern, a logging strategy, and protecting sensitive information.

Error handling — normal, near-normal, and abnormal paths

This chapter classifies the results of a process into normal, near-normal, and abnormal paths and explains handling for each. It covers the criterion separating expected from unexpected failures, when to use exceptions vs. return values, where to catch, and what to tell users and logs.