Skip to content

Commit 99b7edc

Browse files
committedDec 12, 2017
PortUnreachableException should be ECONNREFUSED.
See socketry/nio4r#175.
1 parent 3011d3d commit 99b7edc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎core/src/main/java/org/jruby/Ruby.java

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
import java.lang.invoke.MethodHandle;
173173
import java.lang.ref.WeakReference;
174174
import java.net.BindException;
175+
import java.net.PortUnreachableException;
175176
import java.nio.channels.ClosedChannelException;
176177
import java.nio.charset.Charset;
177178
import java.security.SecureRandom;
@@ -4080,6 +4081,8 @@ public RaiseException newIOErrorFromException(final IOException ex) {
40804081
}
40814082
}
40824083
return newRaiseException(getIOError(), errorMessage);
4084+
} else if (ex instanceof PortUnreachableException) {
4085+
throw newErrnoECONNREFUSEDError();
40834086
}
40844087
return newRaiseException(getIOError(), "IO Error");
40854088
}

0 commit comments

Comments
 (0)
Please sign in to comment.