Exception: X::TooManyRedirects
- Includes:
- RequestContext
- Defined in:
- x-core/lib/x/core/errors/too_many_redirects.rb
Overview
Raised for a response that redirected more times than the client's max_redirects allows
The message names the request whose redirect was one too many, and #http_method and #uri read it: the request that redirect answered, which is the one a client sent last, rather than the one it was first asked for.
Instance Method Summary collapse
-
#http_method ⇒ Symbol?
The HTTP method the request whose redirect was one too many was sent with.
-
#initialize(message = nil, http_method: nil, uri: nil) ⇒ TooManyRedirects
constructor
Initialize a new TooManyRedirects.
-
#uri ⇒ URI::Generic?
The URI the request whose redirect was one too many was sent to.
Constructor Details
#initialize(message = nil, http_method: nil, uri: nil) ⇒ TooManyRedirects
Initialize a new TooManyRedirects
Public, so that code that rescues a TooManyRedirects can be tested with one built by hand, as RedirectHandler builds one, or raised with no message, as any exception is. The error names the request, when given its method and URI, as x-core names the request whose redirect was one too many.
47 48 49 50 |
# File 'x-core/lib/x/core/errors/too_many_redirects.rb', line 47 def initialize( = nil, http_method: nil, uri: nil) name_request(http_method, uri) super( && ()) end |
Instance Method Details
#http_method ⇒ Symbol?
The HTTP method the request whose redirect was one too many was sent with
|
|
# File 'x-core/lib/x/core/errors/too_many_redirects.rb', line 20
|
#uri ⇒ URI::Generic?
The URI the request whose redirect was one too many was sent to
|
|
# File 'x-core/lib/x/core/errors/too_many_redirects.rb', line 20
|