liveBook · Manning

Graceful failure

As explained in Clean Applications with Hexagonal Architecture

A pattern in which a system returns reduced functionality or results when a dependency is unavailable while preserving required behavior and invariants.

When a dependency is unavailable, return a reduced result or skip optional work only if the use case can still preserve its domain invariants. Keep availability handling at the boundary: the domain receives a validated value, a refusal, or DependencyUnavailable without changing its rules. section 11.5

Choose the failure behavior according to what the use case requires:

  • For optional information, use a cached value, omit it, or move the work off the synchronous request path. section 11.5
  • For information that gates a domain decision, do not guess or bypass the check; return DependencyUnavailable and let the caller retry. section 11.5
  • Bound required synchronous calls with chosen timeouts, safe retries, and fast failure; a circuit breaker can stop repeated calls and allow a probe after cooldown. section 11.5

How Clean Applications with Hexagonal Architecture covers it

How deep it goes
Distinguishes safe degradation from required checks and describes circuit-breaker thresholds, cooldown probes, and fast failure.
Examples
Uses a cached or omitted author display name as fallback, but rejects approval when author validation is unavailable.
What you can do after
Apply the pattern by classifying dependency answers as optional or invariant-gating, then degrading only the former.
How it connects
Connects circuit breakers, output ports, asynchronous work, timeouts, retries, and domain invariants.

Also explained in

Compare how 3 books explain graceful failure →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Clean Applications with Hexagonal Architecture. The section links point to the parts of the book it draws on.