Skip to content

Commit

Permalink
Use IO::TimeoutError for timed-out select
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 12, 2025
1 parent 464d94c commit 24a6c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/ext/socket/RubyTCPSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

package org.jruby.ext.socket;

import jnr.constants.platform.Errno;
import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyBasicObject;
Expand Down Expand Up @@ -113,7 +114,7 @@ private SocketChannel attemptConnect(ThreadContext context, IRubyObject host, St
return channel;
}

throw context.runtime.newErrnoETIMEDOUTError();
throw RubyIOTimeoutError.newIOTimeoutError(context.runtime, Errno.ETIMEDOUT.description()).toThrowable();
} catch (ConnectException e) {
// fall through and try next valid address for the host.
}
Expand Down

0 comments on commit 24a6c33

Please sign in to comment.