Skip to content

refactor: reserve plain factory names for Outcome-returning variants#156

Merged
Reefact merged 2 commits into
mainfrom
claude/adr-0005-application-eumwyo
Jul 16, 2026
Merged

refactor: reserve plain factory names for Outcome-returning variants#156
Reefact merged 2 commits into
mainfrom
claude/adr-0005-application-eumwyo

Conversation

@Reefact

@Reefact Reefact commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Apply ADR-0005 across the FirstClassErrors.Usage samples and the documentation: the Outcome-returning factory carries the plain name and the throwing variant takes the OrThrow suffix, so no method returning an Outcome wears the Try prefix whose bool+out shape it never honours.

Type of change

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

Changes

  • Temperature: TryFromKelvin/TryFromCelsiusFromKelvin/FromCelsius (Outcome-returning); the throwing FromKelvin/FromCelsiusFromKelvinOrThrow/FromCelsiusOrThrow; the AbsoluteZero call site and the "Attempts to create…" XML-doc summaries are updated to match.
  • Amount: the throwing Add/SubtractAddOrThrow/SubtractOrThrow. The boolean predicates IsGreaterThan/IsLessThan are left unchanged (the OrThrow marker is not idiomatic on a bool-returning predicate).
  • Docs (EN + FR, in lockstep): reword the GettingStarted, UsagePatterns and OutcomeGuide examples (TryAdd/TryParseAmount/TryCreateAmount, and the non-factory TryAlternativeProviderAsyncAlternativeProviderAsync), and align the Amount.Add prose references in WritingErrorMessages and WritingErrorsGuide.
  • Note: these are renames of public members in the unpublished Usage samples project; the published packages (FirstClassErrors, FirstClassErrors.Testing) are untouched, so no published-package API changes.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln — 728 passed, 0 failed (incl. GenDoc.UnitTests, confirming the error-catalog snapshots are unaffected)
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests) — 85 passed

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/*.fr.md) updated in lockstep with the English docs
  • No documentation change required

Architecture decisions

  • No architectural decision in this pull request

Implements the already-accepted ADR-0005 (Reserve the plain factory name for the Outcome-returning variant). No new decision is recorded, nothing is superseded, and nothing conflicts with the ADR base. The ADR file itself is intentionally left untouched — it documents the decision using the pre-rename names.

Related issues

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_013eNZiEbSu9gdvUSLBoPNd4


Generated by Claude Code

claude and others added 2 commits July 16, 2026 01:06
Apply ADR-0005 across the Usage samples and the documentation: the
Outcome-returning factory carries the plain name and the throwing
variant takes the OrThrow suffix, so no method returning an Outcome
wears the Try prefix whose bool+out shape it never honours.

- Temperature: TryFromKelvin/TryFromCelsius become FromKelvin/FromCelsius
  (Outcome), the throwing FromKelvin/FromCelsius become
  FromKelvinOrThrow/FromCelsiusOrThrow, and the AbsoluteZero call site
  and the "Attempts to create" XML-doc summaries are updated to match.
- Amount: the throwing Add/Subtract become AddOrThrow/SubtractOrThrow.
- Docs (EN + FR): reword the GettingStarted, UsagePatterns and
  OutcomeGuide examples (TryAdd/TryParseAmount/TryCreateAmount, and the
  non-factory TryAlternativeProviderAsync), and align the Amount.Add
  prose references in WritingErrorMessages and WritingErrorsGuide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013eNZiEbSu9gdvUSLBoPNd4
@Reefact
Reefact enabled auto-merge July 16, 2026 01:21
@Reefact
Reefact merged commit 635e4fc into main Jul 16, 2026
12 checks passed
@Reefact
Reefact deleted the claude/adr-0005-application-eumwyo branch July 16, 2026 01:24
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.

2 participants