Class SafeFetchException

All Implemented Interfaces:
Serializable

public class SafeFetchException extends IOException
A URL SafeHttpFetcher read nothing usable from, with the SafeFetchFailure saying why and, for an error status, the status. An IOException so that it travels out of the HTTP client's response handler unchanged.
See Also:
  • Constructor Details

    • SafeFetchException

      public SafeFetchException(SafeFetchFailure failure)
      Builds the exception for a failure.
      Parameters:
      failure - why nothing was read
    • SafeFetchException

      public SafeFetchException(SafeFetchFailure failure, Throwable cause)
      Builds the exception for a failure, keeping its cause for the logs.
      Parameters:
      failure - why nothing was read
      cause - what failed
    • SafeFetchException

      public SafeFetchException(SafeFetchFailure failure, int status)
      Builds the exception for an answer whose status is the failure.
      Parameters:
      failure - why nothing was read
      status - the HTTP status answered, -1 when none was
  • Method Details

    • getFailure

      public SafeFetchFailure getFailure()
      Returns:
      why nothing was read
    • getStatus

      public int getStatus()
      Returns:
      the HTTP status answered when the status is the failure, -1 otherwise