Class RetryAfterException

All Implemented Interfaces:
Serializable

public class RetryAfterException extends RuntimeException
This exception is raised when an http endpoint returns with a response telling the caller to make the same request after a certain period of time. Typically, this is returned with a 503 status code, as specified in the
invalid reference
HttpHeaders#RETRY_AFTER
header.
See Also:
  • Constructor Details

    • RetryAfterException

      public RetryAfterException(String message, int seconds)
      Construct an exception instance to happen at a time in the future
      Parameters:
      message - message
      seconds - retry after delta. Negative values are converted to zero
    • RetryAfterException

      public RetryAfterException(Throwable cause, int seconds)
      Construct an exception instance to happen at a time in the future
      Parameters:
      cause - cause
      seconds - retry after delta. Negative values are converted to zero
    • RetryAfterException

      public RetryAfterException(String message, Throwable cause, int seconds)
      Construct an exception instance to happen at a time in the future
      Parameters:
      message - message
      cause - cause
      seconds - retry after delta. Negative values are converted to zero
  • Method Details

    • getSeconds

      public int getSeconds()
      Get the value of the retry time
      Returns:
      the retry time, in seconds. This is always zero or positive.