Sha256: 96223ebb9c2eafa32abfaf5e6e239713b98be15bbf913e56e72c1ad78d4dd83b

Contents?: true

Size: 1.07 KB

Versions: 56

Compression:

Stored size: 1.07 KB

Contents

module Resourceful

  # This exception used to indicate that the request did not succeed.
  # The HTTP response is included so that the appropriate actions can
  # be taken based on the details of that response
  class UnsuccessfulHttpRequestError < Exception
    attr_reader :http_response, :http_request
 
    # Initialize new error from the HTTP request and response attributes.
    def initialize(http_request, http_response)
      super("#{http_request.method} request to <#{http_request.uri}> failed with code #{http_response.code}")
      @http_request = http_request
      @http_response = http_response
    end
  end

  class MalformedServerResponse < UnsuccessfulHttpRequestError
  end
      

  # Exception indicating that the server used a content coding scheme
  # that Resourceful is unable to handle.
  class UnsupportedContentCoding < Exception
  end

  # Raised when a body is supplied, but not a content-type header
  class MissingContentType < ArgumentError
    def initialize
      super("A Content-Type must be specified when an entity-body is supplied.")
    end
  end

end

Version data entries

56 entries across 56 versions & 6 rubygems

Version Path
paul-resourceful-0.5.0 lib/resourceful/exceptions.rb
paul-resourceful-0.5.3 lib/resourceful/exceptions.rb
paul-resourceful-0.5.4 lib/resourceful/exceptions.rb
paul-resourceful-0.6.0 lib/resourceful/exceptions.rb
pezra-resourceful-0.5.4 lib/resourceful/exceptions.rb
pezra-resourceful-0.6.0 lib/resourceful/exceptions.rb
pezra-resourceful-0.7.0 lib/resourceful/exceptions.rb
abiquo-etk-0.6.4 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.6.3 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.6.2 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.6.1 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.6.0 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.5.9 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.5.8 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.5.3 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.4.42 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
almodovar-0.5.6 vendor/resourceful-0.5.3-patched/lib/resourceful/exceptions.rb
almodovar-0.5.5 vendor/resourceful-0.5.3-patched/lib/resourceful/exceptions.rb
abiquo-etk-0.4.33 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb
abiquo-etk-0.4.32 vendor/resourceful-1.0.1/lib/resourceful/exceptions.rb