Skip to content

Commit 9304b9e

Browse files
committed
[GR-27045] NFIUnsatisfiedLinkError no longer inherits from UnsatisfiedLinkError
PullRequest: truffleruby/2150
2 parents 38c1bdf + bbe25bb commit 9304b9e

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/main/java/org/truffleruby/language/loader/RequireNode.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Object findFunctionInLibrary(Object library, String functionName, String path) {
319319
private void handleCExtensionException(String feature, Exception e) {
320320
TranslateExceptionNode.logJavaException(getContext(), this, e);
321321

322-
final UnsatisfiedLinkError linkErrorException = searchForException(UnsatisfiedLinkError.class, e);
322+
final Throwable linkErrorException = searchForException("NFIUnsatisfiedLinkError", e);
323323
if (linkErrorException != null) {
324324
final String linkError = linkErrorException.getMessage();
325325

@@ -363,17 +363,6 @@ private void handleCExtensionException(String feature, Exception e) {
363363
}
364364
}
365365

366-
private <T extends Throwable> T searchForException(Class<T> exceptionClass, Throwable exception) {
367-
while (exception != null) {
368-
if (exceptionClass.isInstance(exception)) {
369-
return exceptionClass.cast(exception);
370-
}
371-
exception = exception.getCause();
372-
}
373-
374-
return null;
375-
}
376-
377366
private Throwable searchForException(String exceptionClass, Throwable exception) {
378367
while (exception != null) {
379368
if (exception.getClass().getSimpleName().equals(exceptionClass)) {

0 commit comments

Comments
 (0)