Class RedirectionException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RedirectionLoopException, TooManyRedirectsException

public class RedirectionException extends UnexpectedStatusException
An Exception that's thrown when the server returns a (unhandled) redirect.

There are two subclasses for specific error conditions: TooManyRedirectsException and RedirectionLoopException.

See Also:
  • Constructor Details

    • RedirectionException

      public RedirectionException(HttpStatus status, URI redirectingLocation, URI newLocation)
    • RedirectionException

      public RedirectionException(HttpStatus status, String message, URI redirectingLocation, URI newLocation)
  • Method Details

    • redirectingLocation

      public URI redirectingLocation()
      Returns the URI of the location that returned the redirect.
      Returns:
      A URI.
    • newLocation

      public URI newLocation()
      Returns the new URI as returned by the server, may be null for some status codes.
      Returns:
      A URI or null.