Sha256: fb4a15311ec712b8a7e11e88072209943d31c18283bc238f8fa7863519e4c7c0

Contents?: true

Size: 329 Bytes

Versions: 7

Compression:

Stored size: 329 Bytes

Contents

module Vertebrae
  module Response
    class RaiseError < Faraday::Response::Middleware

      def on_complete(response)
        status_code = response[:status].to_i
        if (400...600).include? status_code
          raise ResponseError.new(status_code, response)
        end
      end
    end
  end # Response::RaiseError
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vertebrae-0.6.0 lib/response/raise_error.rb
vertebrae-0.5.1 lib/response/raise_error.rb
vertebrae-0.5.0 lib/response/raise_error.rb
vertebrae-0.4.3 lib/response/raise_error.rb
vertebrae-0.4.2 lib/response/raise_error.rb
vertebrae-0.4.1 lib/response/raise_error.rb
vertebrae-0.4.0 lib/response/raise_error.rb