Skip to content

Commit

Permalink
Improve timeout error during jruby ssl connection
Browse files Browse the repository at this point in the history
This fixes nahi#381 by adding explicit handling for
Java::JavaNet::SocketTimeoutException when establishing a JRuby SSL
connection.
  • Loading branch information
Dave Golombek committed Oct 23, 2017
1 parent 27fbb07 commit 613f412
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/httpclient/jruby_ssl_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ def initialize(socket, dest, config, opts = {})
ssl_connect(dest.host)
rescue java.security.GeneralSecurityException => e
raise OpenSSL::SSL::SSLError.new(e.getMessage)
rescue java.javanet.SocketTimeoutException => e
raise HTTPClient::ConnectTimeoutError.new(e.getMessage)
rescue java.io.IOException => e
raise OpenSSL::SSL::SSLError.new("#{e.class}: #{e.getMessage}")
end
Expand Down

0 comments on commit 613f412

Please sign in to comment.