Skip to content

Commit

Permalink
Need to throw the exception message to give more information (#1429)
Browse files Browse the repository at this point in the history
If running on a system that does not have the required glibc
version then important information is lost to tell the user
what is wrong. For example:

version 'GLIBC_2.34' not found (required by .../libswt-pi3-gtk-4966r6.so)

The fallback is tried if that fails then its exception is added
as suppressed by the original exception and the original is thrown.
  • Loading branch information
tjwatson authored Sep 4, 2024
1 parent 482c7ca commit d200d94
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,24 @@ public class OS extends C {
Library.loadLibrary("swt-pi4");
} catch (Throwable e) {
System.err.println("SWT OS.java Error: Failed to load swt-pi4, loading swt-pi3 as fallback.");
Library.loadLibrary("swt-pi3");
try {
Library.loadLibrary("swt-pi3");
} catch (Throwable fallback) {
e.addSuppressed(fallback);
throw e;
}
}
} else {
try {
Library.loadLibrary("swt-pi3");
} catch (Throwable e) {
System.err.println("SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.");
Library.loadLibrary("swt-pi4");
try {
Library.loadLibrary("swt-pi4");
} catch (Throwable fallback) {
e.addSuppressed(fallback);
throw e;
}
}
}
}
Expand Down

0 comments on commit d200d94

Please sign in to comment.