Skip to content

formatServerError shows Unknown error for structured API payloads #31643

Description

@Desperado

Description

formatServerError in packages/app/src/utils/server-errors.ts handles Error, strings, and typed config/model errors, but plain objects from the API often fall through to "Unknown error".

Example payloads that should display a useful message:

  • { data: { message: "Sidecar unavailable" } }
  • { message: "Connection refused" }
  • { name: "ServerTimeoutError", data: { seconds: 30 } }

This shows up in desktop/web UI error toasts when the sidecar returns structured JSON instead of an Error instance.

Steps to reproduce

  1. Surface an API error object with data.message (not an Error instance) to formatServerError.
  2. Observe "Unknown error" instead of the message field.

Operating System

Any (app package)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions