Skip to content

Commit

Permalink
WIP: Attempt to raise a ConnectionError on
Browse files Browse the repository at this point in the history
  - open timeout is treated as a failure to connect
  • Loading branch information
olleolleolle committed May 4, 2020
1 parent 87ecaf9 commit 7891b32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/faraday/adapter/net_http_persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def perform_request(http, env)
http.request env[:url], create_request(env)
rescue Errno::ETIMEDOUT => e
raise Faraday::TimeoutError, e
rescue Net::OpenTimeout => e
raise Faraday::ConnectionFailed, e
rescue Net::HTTP::Persistent::Error => e
raise Faraday::TimeoutError, e if e.message.include? 'Timeout'

Expand Down

0 comments on commit 7891b32

Please sign in to comment.