Skip to content

Add docs for how the client handles API errors and what contributors should do in new hooks #460

Description

@Chucks1093

Summary

Error handling in React Query hooks is inconsistent across the codebase. Some hooks surface errors to the UI, others swallow them silently. Contributors need a documented pattern to follow when writing new hooks so error handling is consistent from the start.

Scope

  • Document the standard error handling pattern: what to do in onError, when to show a toast vs an inline error state, and when to let the error boundary catch it
  • Add a note on how to distinguish network errors from API validation errors (4xx vs 5xx)
  • Include a worked example of a hook that handles both error types correctly

Acceptance Criteria

  • Pattern for onError is documented
  • Toast vs inline error vs error boundary decision is explained
  • 4xx vs 5xx distinction is covered
  • Worked example is included

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions