Package io.meeds.commons.http
Class SafeFetchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
io.meeds.commons.http.SafeFetchException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionSafeFetchException(SafeFetchFailure failure) Builds the exception for a failure.SafeFetchException(SafeFetchFailure failure, int status) Builds the exception for an answer whose status is the failure.SafeFetchException(SafeFetchFailure failure, Throwable cause) Builds the exception for a failure, keeping its cause for the logs. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SafeFetchException
Builds the exception for a failure.- Parameters:
failure- why nothing was read
-
SafeFetchException
Builds the exception for a failure, keeping its cause for the logs.- Parameters:
failure- why nothing was readcause- what failed
-
SafeFetchException
Builds the exception for an answer whose status is the failure.- Parameters:
failure- why nothing was readstatus- the HTTP status answered, -1 when none was
-
-
Method Details
-
getFailure
- Returns:
- why nothing was read
-
getStatus
public int getStatus()- Returns:
- the HTTP status answered when the status is the failure, -1 otherwise
-