Skip to content

Error handling #19

@Joel-Joseph-George

Description

@Joel-Joseph-George

Context

Background

Each sync step should fail independently — a single failing step should
not crash or block the rest of the sync sequence. Errors are stored in
MMKV per step and surfaced inline on the home screen.

Tasks

Per-step error handling

  • Wrap each API call individually in try/catch
  • On network error or non-2xx response, store the error in MMKV:
    sync_error_<step> with the error message string
  • Do not throw or bubble up — let the next step continue

Step keys

MMKV key Step
sync_error_projects GET /users/:userId/projects
sync_error_chapter_assignments GET /users/:userId/chapter-assignments
sync_error_project_units Deriving project_units
sync_error_bible_texts POST /bibles/:bibleId/bulk-texts

Acceptance criteria

  • A failing step does not crash or block subsequent steps
  • Each failed step writes its error message to the correct
    sync_error_<step> key in MMKV
  • Errors are visible inline on the home screen per step
    (handled by #XX Inline sync status UI)
  • No global error toast is shown

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In Progress (Dev)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions