Answers with something rather than failing, once everything else has been
tried: stale data, an empty list, a degraded result.
It belongs outermost, where the failure it sees is the one the caller would
otherwise have caught. It is a TypedPolicy rather than a
Policy because it produces a result, and a result has a type, so it
wraps a stack rather than sitting in one:
The handler receives the failure, so "fall back only for this" is a decision
you make with the error in hand rather than one this package makes for you.
Answers with something rather than failing, once everything else has been tried: stale data, an empty list, a degraded result.
It belongs outermost, where the failure it sees is the one the caller would otherwise have caught. It is a TypedPolicy rather than a Policy because it produces a result, and a result has a type, so it wraps a stack rather than sitting in one:
The handler receives the failure, so "fall back only for this" is a decision you make with the error in hand rather than one this package makes for you.