Sha256: 637d48c85b9665124a30b52819e34c25528aa31b3a5a512857c4f46158225676

Contents?: true

Size: 305 Bytes

Versions: 5

Compression:

Stored size: 305 Bytes

Contents

require 'faraday'

module Faraday
  class Response::RaiseRapidashError < Response::Middleware

    def on_complete(env)
      status = env[:status].to_i
      klass = Rapidash.response_exception_class || Rapidash::ResponseError
      raise klass.new(env) if (400..599).include?(status)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rapidash-0.4.0 lib/faraday/response/raise_rapidash_error.rb
rapidash-0.3.1 lib/faraday/response/raise_rapidash_error.rb
rapidash-0.3.0 lib/faraday/response/raise_rapidash_error.rb
rapidash-0.3.0.beta2 lib/faraday/response/raise_rapidash_error.rb
rapidash-0.3.0.beta lib/faraday/response/raise_rapidash_error.rb