1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

RedirectionTooDeep contains the last response

This commit is contained in:
Sandro Turriate 2010-01-29 16:03:43 -05:00
parent aed3290d62
commit f9ea6bf5e3

View file

@ -5,6 +5,21 @@ module HTTParty
# Exception raised when using a URI scheme other than HTTP or HTTPS
class UnsupportedURIScheme < StandardError; end
# Exception that is raised when request has redirected too many times
class RedirectionTooDeep < StandardError; end
# @abstract Exceptions which inherit from ResponseError contain the Net::HTTP
# response object accessible via the {#response} method.
class ResponseError < StandardError
# Returns the response of the last request
# @return [Net::HTTPResponse]
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
end