ODMA

Error contracts

← Back to concept

Preserve meaning across boundaries

failure → explicit error contract → upper-level handler → user-visible result

Expected failures such as validation, missing data or API rejection use the existing result contract. Broken invariants, malformed responses and programming errors must not become empty data or fake success.

Infrastructure reports the failure; domain or application code interprets it; an upper boundary chooses presentation. Logging alone is not handling. Preserve the original cause when transforming an error.

A missing CMS page remains 404. Unavailable required infrastructure is a server failure. Test both the contract and the resulting user-visible behavior, including retry and data preservation.