Sha256: 0cec2eb4435e992ebebdaf3a81cd777dd625e1e63c9864e6a031628ace45829f

Contents?: true

Size: 333 Bytes

Versions: 2

Compression:

Stored size: 333 Bytes

Contents

module VulnDBHQ
  module Response
    class RaiseClientError < Faraday::Response::Middleware

      def on_complete(env)
        status_code = env[:status].to_i
        error_class = VulnDBHQ::Error::ClientError.errors[status_code]
        raise error_class.from_response_body(env[:body]) if error_class
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vulndbhq-0.1.1 lib/vulndbhq/response/raise_client_error.rb
vulndbhq-0.1.0 lib/vulndbhq/response/raise_client_error.rb