Skip to content

docs(error-handling): add error handling conventions doc (#630) - #718

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
omoh5:docs/630-error-handling-conventions
Jul 28, 2026
Merged

docs(error-handling): add error handling conventions doc (#630)#718
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
omoh5:docs/630-error-handling-conventions

Conversation

@omoh5

@omoh5 omoh5 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds docs/error-handling-conventions.md, the single source of truth for how every error category is surfaced in the Access Layer client (toast, inline, section boundary, page boundary, transaction surfaces, network banner).

Also adds a cross-link from docs/state-management.md section 3 (Error Architecture Strategy) to the new conventions doc.

Closes #630.

Acceptance Criteria Coverage

  • Query error handling conventions documented with decision criteria — Mode 2 (Inline) flowchart, ApiError.status cheat sheet, decision flowchart at top of doc
  • Mutation error display patterns documented with examples — Mode 1 (Toast) with branches for status 0 / 4xx / 5xx / 422 validation, plus user-rejection (getSignatureErrorMessage) and off-chain mutation patterns
  • New error type addition process described — Adding a New Error Type section covers WALLET_ERROR_COPY extension in src/utils/errorHandling.utils.ts AND the typed union + Record table pattern in src/utils/claimActionDisabledReason.ts
  • Shared error state component referenced with usage example — Mode 2 uses CreatorProfileErrorState, Mode 3 uses SectionErrorBoundary, Mode 4 uses CreatorPageErrorBoundary and AppErrorBoundary, Mode 5 uses TransactionRetryNotice + TransactionFailureDrawer. Each reference includes a code example and the component prop contract.
  • Document lives in docs/ and cross-links the state management conventions doc — docs/error-handling-conventions.md links prominently from the top (intent line) and from the Cross-references section; docs/state-management.md section 3 now points to it

Changes in this PR

File Change
docs/error-handling-conventions.md New file covering the full convention
docs/state-management.md Cross-link sentence in section 3 Error Architecture Strategy

Why now

Error handling across the client has been inconsistent — some pages use error boundaries, some handle query errors inline, and mutation errors are displayed differently depending on the component. This doc establishes a single decision flowchart (and per-mode reference) so every future component lands in the right bucket.

Cross-references inside the doc

  • State Management section 3 Error Architecture Strategy (boundary vs inline)
  • Error Handling in React Query Hooks (ApiError branching detail)
  • API Layer Conventions (BaseApiService.handleError source)
  • Shared Components (toast/skeleton/empty-state families)
  • Adding a Page and Data Fetching (end-to-end route wiring with boundaries)
  • BuyActionHelperText and ClaimActionHelperText docs (pre-action copy system)

Verification

  • pnpm exec prettier --check docs/error-handling-conventions.md docs/state-management.md -> no style issues
  • No code or test changes — docs only.

…nk from state-management

Adds docs/error-handling-conventions.md covering the five error display modes (toast, inline, section boundary, page boundary, transaction surfaces) plus the network mismatch banner overlay. Documents the ApiError.status cheat sheet, mutation patterns (network, server, validation, rejection), inline error state component usage, and how to extend the wallet/signature error classification (WALLET_ERROR_COPY) and the disabled-reason helper pattern (ClaimActionDisabledReasonKey).

Cross-links from docs/state-management.md section 3 (Error Architecture Strategy) to the new conventions doc as required by issue accesslayerorg#630 acceptance criteria.

Closes accesslayerorg#630
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@omoh5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 7494545 into accesslayerorg:dev Jul 28, 2026
1 check passed
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.

Add docs for error handling conventions covering error boundaries, mutation errors, and query error states

2 participants