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

Add error page #75

Merged
merged 5 commits into from Nov 9, 2021
Merged

Add error page #75

merged 5 commits into from Nov 9, 2021

Conversation

stdavis
Copy link
Member

@stdavis stdavis commented Nov 5, 2021

Closes #72

This PR adds an error boundary component at the root of the application to catch any errors that aren't caught elsewhere in the application. Note: this will not catch errors in async code or event handlers.

You can test it by introducing some sort of code that will throw an uncaught exception on any page. Here's how I tested it in src/pages/Data.jsx:
image

This is what the error page looks like:
image

"RESTART APPLICATION" exits and restarts the application automatically to hopefully get it back into a state that is workable.

"REPORT THIS ISSUE" opens the user's browser to the new issue page for this repo with a bunch of stuff automatically populated. Here's an example of an issue that I created with this button without entering anything manually into the description.

We probably want to set up some sort of crash reporting as well. Sentry would be my first choice since I'm already using it for the roadkill and fleet mobile apps. However, I didn't want to make this decision without @steveoh's blessing.

@stdavis stdavis requested a review from steveoh November 5, 2021 22:18
@github-actions github-actions bot added the enhancement New feature or request label Nov 5, 2021
@stdavis stdavis enabled auto-merge (rebase) November 5, 2021 22:51
@steveoh
Copy link
Member

steveoh commented Nov 5, 2021

You have my blessing for sentry 😁

@stdavis
Copy link
Member Author

stdavis commented Nov 8, 2021

I've gone down a huge rabbit hole trying to implement Sentry. It would be good for both of us to take a look at it together. I've push a wip commit of where I got to. My main issue is trying to call init from the preload script. I've read that it need to be called in main, renderer, and preload. I feel like I'm one webpack config from getting it working.

I did run node sentry-symbols.js to upload the electron symbols.

Some helpful links:

https://docs.sentry.io/platforms/javascript/guides/electron/

getsentry/sentry-electron#366

This comment makes me think that we should just wait until v3 final of @sentry/electron is released.

@steveoh steveoh added skip-changelog tell release drafter to skip this pull request in the release notes and removed skip-changelog tell release drafter to skip this pull request in the release notes labels Nov 8, 2021
@steveoh steveoh changed the title feat: add root error boundary Add error page Nov 9, 2021
steveoh
steveoh previously approved these changes Nov 9, 2021
@stdavis stdavis merged commit 936b8b2 into main Nov 9, 2021
@stdavis stdavis deleted the feat/error-boundary branch November 9, 2021 22:06
@stdavis stdavis mentioned this pull request Dec 23, 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

Successfully merging this pull request may close these issues.

[Request]: Add error boundaries
2 participants