From 0a12aa179be369b91c21ae73da3bd946de3a489b Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Sun, 24 Nov 2024 10:14:06 -0800 Subject: [PATCH] soloader | Catch Throwable within SystemLoadWrapperSoSource instead of Exception. Summary: The unsatisfied link error is bypassing throw here and gets catched only in SoLoader itself, catch it here so we can return nice result. Reviewed By: corporateshark Differential Revision: D66409983 fbshipit-source-id: 0f7ffc68cf08baf49e2dc32a6d5a9f40c2846af8 --- java/com/facebook/soloader/SystemLoadWrapperSoSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/com/facebook/soloader/SystemLoadWrapperSoSource.java b/java/com/facebook/soloader/SystemLoadWrapperSoSource.java index a8d4e86..85c7769 100644 --- a/java/com/facebook/soloader/SystemLoadWrapperSoSource.java +++ b/java/com/facebook/soloader/SystemLoadWrapperSoSource.java @@ -34,7 +34,7 @@ public int loadLibrary(String soName, int loadFlags, StrictMode.ThreadPolicy thr throws IOException { try { System.loadLibrary(soName.substring("lib".length(), soName.length() - ".so".length())); - } catch (Exception e) { + } catch (Throwable e) { LogUtil.e(SoLoader.TAG, "Error loading library: " + soName, e); return LOAD_RESULT_NOT_FOUND; }