Sha256: 9a6966b9a2826fbea0df8da3f7d29ac708cb0391235abd5ccb9fa603fc5309c5

Contents?: true

Size: 1.21 KB

Versions: 87

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module HTTParty
  # @abstract 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
      super(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

87 entries across 86 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/httparty-0.22.0/lib/httparty/exceptions.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/httparty-0.22.0/lib/httparty/exceptions.rb
httparty-0.22.0 lib/httparty/exceptions.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.5 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.4 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.3 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.2 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.1 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
study_line-0.2.0 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/exceptions.rb