Sha256: 4ffb791984f5f3dfd3699da72d3eb37e46f0420ae4ff0499537814777e42d4cd

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

module HTTParty
  # @abstact Exceptions raised by HTTParty inherit from Error
  class Error < StandardError; end

  # Exception raised when you attempt to set a non-existent format
  class UnsupportedFormat < Error; end

  # Exception raised when using a URI scheme other than HTTP or HTTPS
  class UnsupportedURIScheme < Error; end

  # @abstract Exceptions which inherit from ResponseError contain the Net::HTTP
  # response object accessible via the {#response} method.
  class ResponseError < Error
    # Returns the response of the last request
    # @return [Net::HTTPResponse] A subclass of Net::HTTPResponse, e.g.
    # Net::HTTPOK
    attr_reader :response

    # Instantiate an instance of ResponseError with a Net::HTTPResponse object
    # @param [Net::HTTPResponse]
    def initialize(response)
      @response = response
    end
  end

  # Exception that is raised when request has redirected too many times.
  # Calling {#response} returns the Net:HTTP response object.
  class RedirectionTooDeep < ResponseError; end

  # Exception that is raised when request redirects and location header is present more than once
  class DuplicateLocationHeader < ResponseError; end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
httparty-0.15.5 lib/httparty/exceptions.rb
httparty-0.15.4 lib/httparty/exceptions.rb
httparty-0.15.3 lib/httparty/exceptions.rb
httparty-0.15.2 lib/httparty/exceptions.rb
httparty-0.15.1 lib/httparty/exceptions.rb
httparty-0.15.0 lib/httparty/exceptions.rb
httparty-0.14.0 lib/httparty/exceptions.rb