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: Add global error handling. #368

Merged
merged 1 commit into from
Dec 22, 2021
Merged

fix: Add global error handling. #368

merged 1 commit into from
Dec 22, 2021

Conversation

daviroo
Copy link
Contributor

@daviroo daviroo commented Dec 21, 2021

I think this PR can replace #363. It adds global error handling which will catch any fatal errors in the code and display an alert to the user instead of a white screen which was the previous behaviour. I've also added crashlytics reporting of the errors - it remains to be seen how useful this will be and we may want to use a different service for this in the future. I also added the ability for the user to restart the app and contact support in the dialogs. Tested in both ios and android in my local environment. Screenshots below. Ignore the dev debug screens behind the alerts - these won't show in production.

iOS

English
image

Spanish
image
@dolcalmi please check the translation

Android

English
image

Spanish
image
@dolcalmi please check the translation

@daviroo daviroo self-assigned this Dec 21, 2021
@@ -89,6 +90,7 @@
"react-native-push-notification": "^8.1.1",
"react-native-qrcode-svg": "^6.0.6",
"react-native-reanimated": "^2.2.3",
"react-native-restart": "daviroo/react-native-restart.git#master",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this fork?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The released version of this wasn't working for me and there have been further changes on their master branch since. I tested their main branch and it works but jest was unable to resolve the module without the lib directory which is generated as part of the build (not stored on github). I branched the project and added the lib directory.

@daviroo daviroo requested a review from samerbuna December 21, 2021 21:04
samerbuna
samerbuna previously approved these changes Dec 21, 2021
@nicolasburtey
Copy link
Member

@daviroo please use rebase instead of merge

@daviroo daviroo force-pushed the add-global-error-handling branch from eeb0fec to 7bb33e8 Compare December 22, 2021 11:35
@daviroo daviroo merged commit 437a30c into main Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants