-
Notifications
You must be signed in to change notification settings - Fork 0
Description
It is highly recommended to propagate faults through a dedicated error pipeline instead of stream output to take advantage of Combine consistency leveraging try operators in a throwable manner.
Faults should pass over at most three recovery layers before displaying the recovery message in the exception view.
- System space - providing debug instructions to resolve a source of recurring error.
- Application space - providing severity that promotes fluency over verbosity so triviality bloats are diminished.
- User space - providing exceptional flow enabling users to decide about critical actions (system alert with buttons) or recovery view to excuse a cumbersome hit.
The recovery strategy should involve:
- Ignoring erroring occurrence:
- Empty completion of a single value stream.
- Continuation of multiple values stream.
- Retrying from an erroring occurrence which results in subscribing to upstream once again.
- Passing error downstream through transcription gate providing contextual description about nuisance.
For handler convenience, it should be possible to materialize erroring stream completion to Result type.
As a bonus point, recovery could involve debugging mode that collects logs with traces on every step.
The above strategy, metaphorically reduced to a battleship game, adopts Abort, Retry, Fail? anti-pattern and assesses the holistic approach of dealing with bugs. Primely reintroduced and documented in SinkEmAll asks for exhaustive exploration.
Please take care and good luck! ^^