Skip to content

Commit

Permalink
Improve error message on so loading failure
Browse files Browse the repository at this point in the history
Summary: If the exception cause does not have a message, log the toString() of the exception

Differential Revision: D8230263

fbshipit-source-id: d02d0b71f584e9dd82cb0f9bd4d2ee90c3218de9
  • Loading branch information
Wesley Elias Ribeiro authored and facebook-github-bot committed Jun 1, 2018
1 parent 3d69139 commit 470328a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,11 @@ private static void doLoadLibraryBySoName(
|| result == SoSource.LOAD_RESULT_CORRUPTED_LIB_FILE) {
String message = "couldn't find DSO to load: " + soName;
if (error != null) {
message += " caused by: " + error.getMessage();
String cause = error.getMessage();
if (cause == null) {
cause = error.toString();
}
message += " caused by: " + cause;
}
Log.e(TAG, message);
throw new UnsatisfiedLinkError(message);
Expand Down

0 comments on commit 470328a

Please sign in to comment.