This repository was archived by the owner on May 13, 2026. It is now read-only.
refactor(frontend): use ApiError.toUserMessage() instead of 'Network error' fallback - #1011
Merged
Merged
Conversation
…error' fallback
HTTP 4xx/5xx responses across the UI used to fall back to the literal
string "Network error" when the fetch rejected. That mis-categorized
every server error as a network failure — a 404 from /api/schema/{name}
or a 400 from /api/query showed the same scary "Network error" message
as actually losing the link.
Route everything through ApiError.toUserMessage() so:
- True network failures (isNetworkError) still render the network copy.
- HTTP errors surface the server-supplied descriptive message (the
structured 400/404 payload bodies wired up in #1003 / #1007), falling
back to the generic constant only when the server didn't tell us
what went wrong.
toErrorMessage() in schemaUtils now defers to toUserMessage() for
ApiError; toUserMessage() prefers this.message over the generic
constants whenever the server gave us one (synthetic "HTTP <status>"
fallback is filtered out).
QueryTab.tsx is out of scope here — sister task wires its richer error
UI separately.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stops ~28 ad-hoc `'Network error'` string fallbacks across the React UI from mis-labelling HTTP 4xx/5xx responses as network failures. Routes everything through `ApiError.toUserMessage()` so the user sees the actual server message (e.g. a 404 body's "schema not found") and only sees "Network connection failed" when the request really failed at the network layer.
Out of scope
Test plan
🤖 Generated with Claude Code