Skip to content

Commit 788cd5b

Browse files
committedJan 25, 2018
Handle unavailable protocol error from JDK as MRI does.
Fixes #4976
1 parent 600f8bd commit 788cd5b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎core/src/main/java/org/jruby/ext/socket/RubySocket.java

+2
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,8 @@ static void handleSocketException(final Ruby runtime, final SocketException ex,
646646
throw runtime.newErrnoEACCESError("Address already in use - " + caller + " for " + formatAddress(addr));
647647
case "Address already in use" :
648648
throw runtime.newErrnoEADDRINUSEError(caller + " for " + formatAddress(addr));
649+
case "Protocol family unavailable" :
650+
throw runtime.newErrnoEADDRNOTAVAILError(caller + " for " + formatAddress(addr));
649651
}
650652

651653
// This is ugly, but what can we do, Java provides the same exception type

0 commit comments

Comments
 (0)
Please sign in to comment.