Skip to content

Commit

Permalink
handle 407 Proxy Authentication Required with HTTPClient
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 27, 2013
1 parent 7380ffc commit 2aec848
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/faraday/adapter/httpclient.rb
Expand Up @@ -39,6 +39,12 @@ def call(env)
@app.call env
rescue ::HTTPClient::TimeoutError
raise Faraday::Error::TimeoutError, $!
rescue ::HTTPClient::BadResponseError => err
if err.message.include?('status 407')
raise Faraday::Error::ConnectionFailed, %{407 "Proxy Authentication Required "}
else
raise Faraday::Error::ClientError, $!
end
rescue Errno::ECONNREFUSED
raise Faraday::Error::ConnectionFailed, $!
end
Expand Down

0 comments on commit 2aec848

Please sign in to comment.