Errors as values
Failure is part of the operation's return contract.
Failure boundaries
Why
A missing source or invalid input is an expected outcome. Callers should handle its typed variant without searching exception messages.
Rules
MUST return a typed Result for an operation that can fail predictably.[review]
MUST classify domain failures by a typed variant or discriminant.[review]
MUST propagate a failed outcome until the boundary responsible for presentation handles it.[review]
MUST keep authored throwing, raising, panicking, and exception-control-flow branches out of application behavior.[review]
MUST adapt third-party exceptions inside the resource-owning boundary using the language pack's supported conversion mechanism.[review]
MUST preserve a useful cause and context when converting a failure.[review]
MUST avoid unchecked extraction from success/failure containers.[review]
MUST keep cancellation and process termination distinct from recoverable domain failures.[review]
[review]
Configured language checks can reject exception syntax and unchecked extraction. Failure-path tests and review establish propagation and adapter coverage.
Enforcement
Configured language checks can reject exception syntax and unchecked extraction. Failure-path tests and review establish propagation and adapter coverage.