Skip to content

fix(api): show the Socket API's error message on failed requests - #1627

Merged
Oskar Haarklou Veileborg (BarrensZeppelin) merged 1 commit into
v1.xfrom
oskar/rea-875-api-error-messages
Oct 19, 2026
Merged

Oskar Haarklou Veileborg (BarrensZeppelin) merged 1 commit into
v1.xfrom
oskar/rea-875-api-error-messages

Conversation

@BarrensZeppelin

@BarrensZeppelin Oskar Haarklou Veileborg (BarrensZeppelin) commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

sendApiRequest and queryApiSafeTextWithStatus now include the
error.message the Socket API returns in its error body, next to the
generic per-status guidance they already gave. The API uses it to explain
failures the status code alone can't, such as a version spec it can't
serve.

getDefaultApiBaseUrl always falls back to the default API URL, so its
return type is now string and the unreachable "not configured" branches
are gone.

Part of REA-875.

Expected reviewer effort: Stamp


Stack created with GitHub Stacks CLI • Give Feedback 💬


Note

Low Risk
Localized CLI error messaging and type cleanup around API base URL; no auth or request behavior changes beyond richer failure text.

Overview
Failed Socket API calls from sendApiRequest and queryApiSafeTextWithStatus now surface the server’s error.message from the JSON body (when present) alongside the existing status-text, per-status guidance, and path in the error cause, via a shared describeApiFailure helper.

getDefaultApiBaseUrl is typed to always return a string because it always falls back to API_V0_URL, so the removed “API not configured” error paths in queryApi and sendApiRequest are no longer reachable.

Reviewed by Cursor Bugbot for commit c0a16fb. Configure here.

sendApiRequest and queryApiSafeTextWithStatus now include the
`error.message` the Socket API returns in its error body, next to the
generic per-status guidance they already gave. The API uses it to explain
failures the status code alone can't, such as a version spec it can't
serve.

getDefaultApiBaseUrl always falls back to the default API URL, so its
return type is now `string` and the unreachable "not configured" branches
are gone.
@BarrensZeppelin
Oskar Haarklou Veileborg (BarrensZeppelin) merged commit 585506c into v1.x Oct 19, 2026
11 checks passed
@BarrensZeppelin
Oskar Haarklou Veileborg (BarrensZeppelin) deleted the oskar/rea-875-api-error-messages branch October 19, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants