Skip to content

Commit acddd54

Browse files
committed
[refactor] wrap cause and debug around io exceptions
1 parent 5c176d9 commit acddd54

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/jruby/ext/openssl/SSLSocket.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,9 @@ private IRubyObject sysreadImpl(final ThreadContext context,
837837
buffStr.setValue(new ByteList(bytesRead, offset, read, false));
838838
return buffStr;
839839
}
840-
catch (IOException ioe) {
841-
throw runtime.newIOError(ioe.getMessage());
840+
catch (IOException ex) {
841+
debug(runtime, "SSLSocket.sysreadImpl failed", ex);
842+
throw Utils.newError(runtime, runtime.getIOError(), ex);
842843
}
843844
}
844845

@@ -920,8 +921,9 @@ private IRubyObject syswriteImpl(final ThreadContext context,
920921

921922
return runtime.newFixnum(written);
922923
}
923-
catch (IOException ioe) {
924-
throw runtime.newIOError(ioe.getMessage());
924+
catch (IOException ex) {
925+
debug(runtime, "SSLSocket.syswriteImpl failed", ex);
926+
throw Utils.newError(runtime, runtime.getIOError(), ex);
925927
}
926928
}
927929

0 commit comments

Comments
 (0)