Sha256: c8109ddb093bf51f48364ea8bcda7be74d7fe310776edc73fc672c86c4006c20
Contents?: true
Size: 440 Bytes
Versions: 11
Compression:
Stored size: 440 Bytes
Contents
module Faraday class Response::RaiseError < Response::Middleware def on_complete(env) case env[:status] when 404 raise Faraday::Error::ResourceNotFound, response_values(env) when 400...600 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
11 entries across 11 versions & 3 rubygems