Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/ext/socket/RubyUDPSocket.java
Original file line number Diff line number Diff line change
@@ -129,6 +129,11 @@ public IRubyObject initialize(ThreadContext context, ProtocolFamily family) {
throw runtime.newErrnoECONNREFUSEDError();
} catch (UnknownHostException e) {
throw SocketUtils.sockerr(runtime, "initialize: name or service not known");
} catch (UnsupportedOperationException uoe) {
if (uoe.getMessage().contains("IPv6 not available")) {
throw runtime.newErrnoEAFNOSUPPORTError("socket(2) - udp");
}
throw sockerr(runtime, "UnsupportedOperationException: " + uoe.getLocalizedMessage(), uoe);
} catch (IOException e) {
throw sockerr(runtime, "initialize: name or service not known", e);
}

0 comments on commit e43ee25

Please sign in to comment.