TooManyRedirectsException Class

public class TooManyRedirectsException
extends HttpResponseException

The TooManyRedirectsException represents an exception thrown when an HTTP request has reached the maximum number of redirect attempts.

This exception is typically thrown when the service responds with a status code of 3XX, indicating multiple redirections, and the client has exhausted its limit of redirection attempts.

This class also provides methods to get the HttpResponse that was received when the exception occurred and the deserialized HTTP response value.

Constructor Summary

Constructor Description
TooManyRedirectsException(String message, HttpResponse response)

Initializes a new instance of the TooManyRedirectsException class.

TooManyRedirectsException(String message, HttpResponse response, Object value)

Initializes a new instance of the TooManyRedirectsException class.

TooManyRedirectsException(String message, HttpResponse response, Throwable cause)

Initializes a new instance of the TooManyRedirectsException class.

Methods inherited from HttpResponseException

Methods inherited from java.lang.Object

Methods inherited from java.lang.Throwable

Constructor Details

TooManyRedirectsException

public TooManyRedirectsException(String message, HttpResponse response)

Initializes a new instance of the TooManyRedirectsException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response

TooManyRedirectsException

public TooManyRedirectsException(String message, HttpResponse response, Object value)

Initializes a new instance of the TooManyRedirectsException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response
value - the deserialized response value

TooManyRedirectsException

public TooManyRedirectsException(String message, HttpResponse response, Throwable cause)

Initializes a new instance of the TooManyRedirectsException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response
cause - the Throwable which caused the creation of this TooManyRedirectsException

Applies to