14446ef4d8181bc484358d51cd08c4ad6353bb2eTim Reddehase DEFAULT_MSG = "can't follow the response, and response not useable"
14446ef4d8181bc484358d51cd08c4ad6353bb2eTim Reddehase def initialize(msg=DEFAULT_MSG, last_response: nil)
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase class TooManyRedirectionsError < ArgumentError
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase DEFAULT_MSG = 'too many HTTP redirects encountered'
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase def initialize(msg=DEFAULT_MSG, last_response: nil)
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase # Status-Code should be only used as an option if
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase # you don't have the response object available.
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase def initialize(msg=nil, response: nil, status_code: nil)
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase @status_code = response ? response.code : status_code
c53b52986e31858575023886cdd7327fccd8949cTim ReddehaseEncountered an unexpected status code of #{status_code}.
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase#{"Here is the full response: <#{response}>" if response}