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:
parent
aed3290d62
commit
f9ea6bf5e3
1 changed files with 17 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue