Skip to content

fix(#10): use friendly fallback when API omits error - #21

Closed
dyk1454683243-sudo wants to merge 1 commit into
DevOlabode:mainfrom
dyk1454683243-sudo:fix/10-friendly-request-failed
Closed

dyk1454683243-sudo wants to merge 1 commit into
DevOlabode:mainfrom
dyk1454683243-sudo:fix/10-friendly-request-failed

Conversation

@dyk1454683243-sudo

Copy link
Copy Markdown
Contributor

Summary

Fixes #10 — replace the client fallback 'Request failed' with a short sentence that matches the server voice in utils/friendlyError.js.

Changes

  • src/shared/api.js: when the API omits an error field, show Something went wrong. Please try again. (same wording as the server default)

Out of scope

  • Offline / unreachable-host paragraph left as-is (intentionally more detailed)
  • No API status or response-body changes

Test plan

  • Trigger an API error without an error field (or temporarily force the fallback) and confirm the status toast reads the new sentence
  • Confirm server-provided error strings still surface unchanged

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

@dyk1454683243-sudo is attempting to deploy a commit to the solabode499-5056's projects Team on Vercel.

A member of the Team first needs to authorize it.

@DevOlabode DevOlabode left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix for the missing-error-field case, but there's a gap: when the response body isn't valid JSON (e.g. a 502/503 HTML page from a cold-starting Render backend), parseJson's catch branch returns { error: text } — the raw response text — which is truthy, so it bypasses the friendly fallback entirely. That raw HTML then gets thrown as the ApiError message and rendered verbatim in the popup.

Given this extension already anticipates Render cold-starts elsewhere ("server may still be waking up"), a non-JSON gateway error during wake-up seems like the more likely trigger for issue #10 than a plain missing error field. Can we treat an unparseable/non-JSON error body the same as a missing one, so it also falls through to the friendly message? (src/shared/api.js:52, and the parseJson catch around line 19.)

@dyk1454683243-sudo

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR while I clean up a high-volume open-PR backlog. Sorry for the noise — happy to come back later with a focused change if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize user-facing error messages

2 participants