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.

エラーハンドリング — 正常系・準正常系・異常系

処理の結果を正常系・準正常系・異常系の 3 つに分類し、それぞれに適した扱い方を解説します。想定内の失敗と想定外の失敗を分ける基準、例外と戻り値の使い分け、どの層で捕まえるか、ユーザーとログに何を伝えるかを扱います。