Sha256: 08d705c747110ad6e7ac538f71ba3c3a5f72970d1ee32ac73f2858240fd96925
Contents?: true
Size: 656 Bytes
Versions: 80
Compression:
Stored size: 656 Bytes
Contents
module Faraday class Response::RaiseError < Response::Middleware ClientErrorStatuses = 400...600 def on_complete(env) case env[:status] when 404 raise Faraday::Error::ResourceNotFound, response_values(env) when 407 # mimic the behavior that we get with proxy requests with HTTPS raise Faraday::Error::ConnectionFailed, %{407 "Proxy Authentication Required "} when ClientErrorStatuses raise Faraday::Error::ClientError, response_values(env) end end def response_values(env) {:status => env.status, :headers => env.response_headers, :body => env.body} end end end
Version data entries
80 entries across 73 versions & 10 rubygems