Skip to content

Commit

Permalink
Do not throw IOException for init(Context,ExternalSoMapping)
Browse files Browse the repository at this point in the history
Summary:
This mimics the same behavior of `init(Context, boolean)` and lifts the requirement for
Java consumers to catch an exception explicitely.

See facebook/react-native-website#4397

Differential Revision: D67032849
  • Loading branch information
cortinico authored and facebook-github-bot committed Dec 10, 2024
1 parent 0a12aa1 commit 5d82c8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,15 @@ public static void init(Context context, boolean nativeExopackage) {
* @param externalSoMapping the custom {@link ExternalSoMapping} if the App is using SoMerging.
* @throws IOException IOException
*/
public static void init(Context context, @Nullable ExternalSoMapping externalSoMapping)
throws IOException {
public static void init(Context context, @Nullable ExternalSoMapping externalSoMapping) {
synchronized (SoLoader.class) {
SoLoader.externalSoMapping = externalSoMapping;
}
init(context, 0);
try {
init(context, 0);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}

/**
Expand Down

0 comments on commit 5d82c8f

Please sign in to comment.