-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature/error boundaries #151
Conversation
213a0bd
to
1eaca50
Compare
The change not only adds the component itself, but also uses it to increase error robustness to all apps. So it is nice to mention that also.
The property `children` is by default already included in React.Component, so one usually does not need to specify it. You _can_ specify it though, if you want it to have a more specific or different type than the default. Here it was actually made mandatory, but that seems to be unintended, so I removed it.
In the branch There are some aspects, where I am not so sure whether you should change them, because I am uncertain about your motivation or they may be more a matter of different opinions:
You do not have to answer these points. Feel free to either ignore them or discuss them with me in synchronously instead of asynchronously. |
Lots of great feedback, thanks!
|
…ries_enhancements Feature/error boundaries enhancements
This PR implements https://trello.com/c/By7DaokJ/40-make-initial-implementation-of-react-error-boundaries.
In this PR we add a Error Boundary to
shared
. The purpose of this is that whenever an error occurs in a React component within the Error Boundary, the Error Boundary will catch the error and we can display a descriptive error message and provide the user with tools for recovering. Until this was implemented the users were only shown a blank screen when an error occured within the React tree.We will also send a GA event whenever an error occurs reporting the application, platform, architecture, app version and error message header, which will provide us information about the frequency of these errors.
This PR will only provide Error Boundaries for newer apps with the latest architecture, but as soon as this is merged I will create a PR implementing the same for legacy apps.
The latest update to this PR added an initial test for the Error Boundary. The reason for adding the following to the test
is described here.
TL;DR throwing an error inside a React component will output the error to the console, even if it is caught by a Error Boundary. So we suppress this message to not pollute the console output.