Skip to content

Standardize service-layer errors for async states #345

Description

@Abidoyesimze

Summary

Mock services and async hooks use inconsistent error shapes and messages.

Affected files

  • src/lib/mock-services.ts
  • src/hooks/useAsyncState.ts

Tasks

  • Define one predictable error type (code, message, optional details).
  • Map mock service failures to that shape.
  • Update useAsyncState consumers to rely on the unified contract.

Acceptance criteria

  • Scope is limited to the files listed (or agreed alternatives in the PR).
  • Change is verifiable: tests, screenshots, or written QA steps in the PR.
  • No behavior regressions in related user flows.
  • No new duplicate abstractions without a one-line rationale in the PR.

Suggested labels

cleanup, refactor, frontend

Notes

Standalone cleanup issue from CLEANUP_ISSUES_2026-05.md. Complements the audit queue and product backlog.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions