Package io.tus.java.client
Class ProtocolException
java.lang.Object
java.lang.Throwable
java.lang.Exception
io.tus.java.client.ProtocolException
- All Implemented Interfaces:
Serializable
This exception is thrown if the server sends a request with an unexpected status code or
missing/invalid headers.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProtocolException
(String message) Instantiates a new Object of typeProtocolException
.ProtocolException
(String message, HttpURLConnection connection) Instantiates a new Object of typeProtocolException
. -
Method Summary
Modifier and TypeMethodDescriptionReturns theHttpURLConnection
instances, which caused the error.boolean
Determines whether a retry attempt should be made after aProtocolException
or not.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ProtocolException
Instantiates a new Object of typeProtocolException
.- Parameters:
message
- Message to be thrown with the exception.
-
ProtocolException
Instantiates a new Object of typeProtocolException
.- Parameters:
message
- Message to be thrown with the exception.connection
-HttpURLConnection
, where the error occurred.
-
-
Method Details
-
getCausingConnection
Returns theHttpURLConnection
instances, which caused the error.- Returns:
HttpURLConnection
-
shouldRetry
public boolean shouldRetry()Determines whether a retry attempt should be made after aProtocolException
or not.- Returns:
true
if there should be a retry attempt.
-