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(Android): prevent throwing exception with UnsatisfiedLinkError #2128

Merged
merged 1 commit into from
May 13, 2024

Conversation

piaskowyk
Copy link
Member

Description

Fixes #2115

The System.loadLibrary("rnscreens") can throw an exception that inherits from the Error class instead of the Exception class.

@piaskowyk piaskowyk requested a review from kkafar May 10, 2024 18:55
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Makes sense.

My only worry is whether this is only type of exception that can be thrown here. Maybe going with more generic error type could be worth considering

@piaskowyk
Copy link
Member Author

According to the Android documentation in our case only UnsatisfiedLinkError exception can be thrown.

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

This convinces me

@piaskowyk piaskowyk merged commit 9d31514 into main May 13, 2024
4 checks passed
@piaskowyk piaskowyk deleted the @piaskowyk/catch-UnsatisfiedLinkError branch May 13, 2024 07:33
@tboba tboba changed the title Catch UnsatisfiedLinkError fix(Android): prevent throwing exception with UnsatisfiedLinkError May 13, 2024
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
## Description

Fixes
software-mansion#2115

The `System.loadLibrary("rnscreens")` can throw an exception that
inherits from the `Error` class instead of the `Exception` class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants