Skip to content

Improve error feedback in the UI with structured messages #15

@BunsDev

Description

@BunsDev

Problem

API errors currently surface as generic "Unexpected server error" messages in the UI. Users have no way to understand what went wrong or how to fix it. On the server side, some try-catch blocks silently swallow errors (especially during JSON parsing in ingestion).

Proposed Solution

Server Side

  1. Error codes — Define an enum of error codes (e.g., AUTH_FAILED, VALIDATION_ERROR, DB_ERROR, NOT_FOUND)
  2. Structured error responses{ error: { code: string, message: string, details?: object } }
  3. Error logging — Replace silent catches with structured logging that includes context

Client Side

  1. Error display component — Reusable component that renders errors based on code/type
  2. User-friendly messages — Map error codes to actionable messages
  3. Toast notifications — Use existing toast/sonner for non-blocking errors
  4. Retry affordance — Where appropriate, offer a "Try again" button

Acceptance Criteria

  • All API routes return structured error responses with error codes
  • No silent error swallowing — all caught errors are logged with context
  • UI displays meaningful error messages (not raw error text)
  • Critical errors show inline; transient errors use toast notifications
  • At least one "retry" affordance for recoverable errors

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuxUser interface and experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions