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

Replace console.error with throw new Error #4452

Merged
merged 1 commit into from
May 15, 2023
Merged

Conversation

tomekzaw
Copy link
Member

Summary

This PR changes the behavior of the app when version mismatch is detected. Previously, we called console.error in such case, but the app still continued to execute. This PR replaces console.error with throw new Error which stops the execution and shows full-screen LogBox.

Before After
before after

@tomekzaw tomekzaw requested a review from tjzel May 15, 2023 08:43
Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

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

But why are the versions on provided screenshots the same? 🤔

@tomekzaw
Copy link
Member Author

I've just changed !ok to ok for testing purposes in order to see how the error will look like.

@tomekzaw tomekzaw added this pull request to the merge queue May 15, 2023
Merged via the queue into main with commit 3c95c2d May 15, 2023
@tomekzaw tomekzaw deleted the @tomekzaw/mismatch-error branch May 15, 2023 09:21
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Summary

This PR changes the behavior of the app when version mismatch is
detected. Previously, we called `console.error` in such case, but the
app still continued to execute. This PR replaces `console.error` with
`throw new Error` which stops the execution and shows full-screen
LogBox.

| Before | After |
|:-:|:-:|
| <img width="459" alt="before"
src="https://github.com/software-mansion/react-native-reanimated/assets/20516055/4b58c8f8-350a-4d17-8c3a-51a9a3cf1fc9">
| <img width="459" alt="after"
src="https://github.com/software-mansion/react-native-reanimated/assets/20516055/53cd425f-4da1-4ff4-86c8-776fdcbfe4a0">
|
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.

2 participants