From d8d67cd057a8bad3e66d6e4d6338179801464daa Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 6 May 2024 13:03:34 -0500 Subject: [PATCH] Convert IOException to Ruby exception correctly Many libraries depend on us raising the actual Errno exceptions for what comes out of Java as IOException. The utilities in JRuby exist to convert these IOException objects into the appropriate Errno exception by examining the exception type and message. This patch switches one key place for #242 to use this utility method. --- src/main/java/org/jruby/ext/openssl/SSLSocket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jruby/ext/openssl/SSLSocket.java b/src/main/java/org/jruby/ext/openssl/SSLSocket.java index 36c61508..ed336bdb 100644 --- a/src/main/java/org/jruby/ext/openssl/SSLSocket.java +++ b/src/main/java/org/jruby/ext/openssl/SSLSocket.java @@ -951,7 +951,7 @@ private IRubyObject syswriteImpl(final ThreadContext context, } catch (IOException ex) { debugStackTrace(runtime, "SSLSocket.syswriteImpl", ex); - throw Utils.newError(runtime, runtime.getIOError(), ex); + throw runtime.newIOErrorFromException(ex); } }