Skip to content

Clarify usage patterns and Outcome composition#121

Draft
Reefact wants to merge 10 commits into
mainfrom
agent/improve-usage-outcome-docs
Draft

Clarify usage patterns and Outcome composition#121
Reefact wants to merge 10 commits into
mainfrom
agent/improve-usage-outcome-docs

Conversation

@Reefact

@Reefact Reefact commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

This PR separates usage decisions from the detailed Outcome API so readers can first choose the right error-propagation pattern, then learn fluent composition without mixing both concerns. It also clarifies how ErrorContext remains attached to an error across outcomes, exceptions, and inner-error composition.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Rewrite the English and French usage-pattern guides around a decision table and concrete domain, validation, batch, incoming-port, and outgoing-port examples.
  • Add dedicated English and French guides for Outcome, Outcome<T>, Then, To, Recover, Finally, exception escape hatches, and asynchronous composition.
  • Explain when fluent composition is clearer than ordinary branching and when it is not.
  • Expand the English and French ErrorContext guides with clear role boundaries, transport-independent propagation, data-safety guidance, and a practical checklist.
  • Correct the documentation to retrieve successful Outcome<T> results through GetResultOrThrow() rather than a non-existent Value property.
  • Keep the English and French structures and navigation links aligned.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

No build or test command was run because this PR changes Markdown documentation only. The examples were checked against the current Outcome, Outcome<T>, port-error, and context APIs, and the branch diff and cross-page navigation were reviewed manually.

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/README.fr.md) updated if user-facing behavior changed
  • No documentation change required

The French counterpart of every changed or added English page is included. doc/README.fr.md itself did not require a change because UsagePatterns.fr.md remains the existing entry point and now links to the dedicated Outcome guide.

Related issues

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant