mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-29 00:03:58 -04:00
parent
c94890c499
commit
f73d13ee09
@ -70,6 +70,8 @@ module Faraday
|
||||
else
|
||||
raise Error::ConnectionFailed, err
|
||||
end
|
||||
rescue Errno::ETIMEDOUT => err
|
||||
raise Error::TimeoutError, err
|
||||
rescue RuntimeError => err
|
||||
if err.message == "connection closed by server"
|
||||
raise Error::ConnectionFailed, err
|
||||
|
@ -40,7 +40,7 @@ module Faraday
|
||||
save_response env, resp.status, resp.body, resp.headers
|
||||
|
||||
@app.call env
|
||||
rescue ::HTTPClient::TimeoutError
|
||||
rescue ::HTTPClient::TimeoutError, Errno::ETIMEDOUT
|
||||
raise Faraday::Error::TimeoutError, $!
|
||||
rescue ::HTTPClient::BadResponseError => err
|
||||
if err.message.include?('status 407')
|
||||
|
@ -54,7 +54,7 @@ module Faraday
|
||||
end
|
||||
|
||||
@app.call env
|
||||
rescue Timeout::Error => err
|
||||
rescue Timeout::Error, Errno::ETIMEDOUT => err
|
||||
raise Faraday::Error::TimeoutError, err
|
||||
end
|
||||
|
||||
|
@ -23,6 +23,8 @@ module Faraday
|
||||
|
||||
def perform_request(http, env)
|
||||
http.request env[:url], create_request(env)
|
||||
rescue Errno::ETIMEDOUT => error
|
||||
raise Faraday::Error::TimeoutError, error
|
||||
rescue Net::HTTP::Persistent::Error => error
|
||||
if error.message.include? 'Timeout'
|
||||
raise Faraday::Error::TimeoutError, error
|
||||
|
Loading…
x
Reference in New Issue
Block a user