Skip to content

Standardize example error codes on UPPER_SNAKE_CASE#118

Merged
Reefact merged 3 commits into
mainfrom
claude/error-handling-library-review-o4lab8
Jul 14, 2026
Merged

Standardize example error codes on UPPER_SNAKE_CASE#118
Reefact merged 3 commits into
mainfrom
claude/error-handling-library-review-o4lab8

Conversation

@Reefact

@Reefact Reefact commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Standardize the example error codes used across the public XML documentation, the testing guide, and the test fixtures on the UPPER_SNAKE_CASE convention recommended by the FCE004 analyzer, replacing the dotted PAYMENT.DECLINED style. This keeps the examples internally consistent and aligned with the format the library nudges users toward.

Type of change

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

Changes

  • Renamed the example error codes from the dotted DOMAIN.REASON form to DOMAIN_REASON (PAYMENT.DECLINEDPAYMENT_DECLINED, PAYMENT.REFUSEDPAYMENT_REFUSED, ORDER.NOT_FOUNDORDER_NOT_FOUND, ORDER.LOCKEDORDER_LOCKED, INVENTORY.OUT_OF_STOCKINVENTORY_OUT_OF_STOCK, SOMETHING.ELSESOMETHING_ELSE) in:
    • public XML documentation — the Error.Code remarks and the ErrorAssertion usage example;
    • the testing guide — doc/Testing.en.md and doc/Testing.fr.md;
    • test fixtures and their expected report strings — OutcomeAssertionsTests, CatalogDifferTests, CatalogDiffFormatterTests.
  • No production behavior change: ErrorCode.Create accepts either form at runtime (only null/whitespace is rejected); only example and fixture strings changed.
  • Out of scope on purpose: doc/CatalogVersioning.{en,fr}.md are handled by PR docs: make catalog versioning easier to understand #117, so they are left untouched here to avoid a conflict.

Testing

  • dotnet build FirstClassErrors.sln — 0 warnings, 0 errors
  • dotnet test FirstClassErrors.sln — 668 passed, 0 failed
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests) — 51 passed

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 English testing guide and its French translation (doc/Testing.fr.md) were updated together, so the two stay in sync. No user-facing behavior changed.

Related issues

None.


Generated by Claude Code

claude and others added 3 commits July 14, 2026 08:20
Align the example error codes in the public XML documentation (Error.Code,
ErrorAssertion) and the testing guide on the UPPER_SNAKE_CASE convention that
FCE004 recommends, replacing the dotted PAYMENT.DECLINED style. Keeps the
documentation consistent with the codes shown across the rest of the guides.
Update the catalog diff/differ and outcome-assertion fixtures (and their
expected report strings) to the UPPER_SNAKE_CASE codes, so the tests match
the convention now used in the documentation and examples.
@Reefact Reefact enabled auto-merge July 14, 2026 08:51
@Reefact Reefact merged commit c7c28c1 into main Jul 14, 2026
12 checks passed
@Reefact Reefact deleted the claude/error-handling-library-review-o4lab8 branch July 14, 2026 08:54
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