Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When our GitHub endpoints return a non-JSON result, show a nice error page. #272

Open
noway opened this issue Sep 24, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@noway
Copy link
Member

noway commented Sep 24, 2021

Is your feature request related to a problem? Please describe.
I'm always frustrated when we have an outage, and we're not showing a nice error on the frontend.

Describe the solution you'd like
When outage happens, our GitHub endpoints (healhpointLocations.json, uniqLocations.json, availability/*.json) show an empty resonse. This fails the Fetch library during parsing (const data = await res.json) and we end up spitting out "Unexpected token < in JSON at position 0" error. We should make a nicer error for this case.

Additional context
Can test this by pointing the endpoints to https://google.com or a website which doesn't return JSON.

@noway noway added the enhancement New feature or request label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant