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
- Surface an API error object with
data.message (not an Error instance) to formatServerError.
- Observe "Unknown error" instead of the message field.
Operating System
Any (app package)
Description
formatServerErrorinpackages/app/src/utils/server-errors.tshandlesError, 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
Errorinstance.Steps to reproduce
data.message(not anErrorinstance) toformatServerError.Operating System
Any (app package)