lib/httpx/connection.rb in httpx-0.22.4 vs lib/httpx/connection.rb in httpx-0.22.5
- old
+ new
@@ -536,15 +536,16 @@
Errno::ENOENT,
SocketError => e
# connect errors, exit gracefully
error = ConnectionError.new(e.message)
error.set_backtrace(e.backtrace)
- connecting? && callbacks(:connect_error).any? ? emit(:connect_error, error) : handle_error(error)
+ connecting? && callbacks_for?(:connect_error) ? emit(:connect_error, error) : handle_error(error)
@state = :closed
emit(:close)
rescue TLSError => e
# connect errors, exit gracefully
handle_error(e)
+ connecting? && callbacks_for?(:connect_error) ? emit(:connect_error, e) : handle_error(e)
@state = :closed
emit(:close)
end
def handle_transition(nextstate)