Skip to content

Error dissolution with layered recovery strategy #18

@lyzkov

Description

@lyzkov

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.

  1. System space - providing debug instructions to resolve a source of recurring error.
  2. Application space - providing severity that promotes fluency over verbosity so triviality bloats are diminished.
  3. 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! ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions