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

fix: display error message if backend is unreachable #540

Merged
merged 13 commits into from
Oct 10, 2022
Merged

Conversation

theborakompanioni
Copy link
Collaborator

@theborakompanioni theborakompanioni commented Oct 10, 2022

Resolves #538.

Changeset is based on #521 (please review/merge #521 first).

Before this PR the app showed a generic error message when the backend was unreachable.
After this PR the app displays an error message with more informative reason, e.g. "No connection to backend: Gateway Timeout.".

At first I tried implementing this behaviour via the recommended react-router-dom's errorElement property (as described in the docs). However, this did not work for reasons not yet known. I will try it again with a future release, as this is a more appropriate error handling mechanism and also enables better separation of data and views, which would be nice to have.

How to test

Checkout the master branch and start the app (with npm start) without starting the regtest environment - verify that you see a generic error message. Switch to this branch (git checkout error-page) and verify that you see a more informative message.

📸 Before/After

@theborakompanioni theborakompanioni added the bug Something isn't working label Oct 10, 2022
@theborakompanioni theborakompanioni self-assigned this Oct 10, 2022
@theborakompanioni theborakompanioni marked this pull request as ready for review October 10, 2022 15:27
Copy link
Contributor

@dergigi dergigi left a comment

Choose a reason for hiding this comment

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

tACK, Looks good to me ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify 404 routes work properly
2 participants