Skip to content

fix: display error message if backend is unreachable#540

Merged
dergigi merged 13 commits intomasterfrom
error-page
Oct 10, 2022
Merged

fix: display error message if backend is unreachable#540
dergigi merged 13 commits intomasterfrom
error-page

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