Package io.tus.java.client
Class ProtocolException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- io.tus.java.client.ProtocolException
-
- All Implemented Interfaces:
java.io.Serializable
public class ProtocolException extends java.lang.Exception
This exception is thrown if the server sends a request with an unexpected status code or missing/invalid headers.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProtocolException(java.lang.String message)
Instantiates a new Object of typeProtocolException
.ProtocolException(java.lang.String message, java.net.HttpURLConnection connection)
Instantiates a new Object of typeProtocolException
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.HttpURLConnection
getCausingConnection()
Returns theHttpURLConnection
instances, which caused the error.boolean
shouldRetry()
Determines whether a retry attempt should be made after aProtocolException
or not.
-
-
-
Constructor Detail
-
ProtocolException
public ProtocolException(java.lang.String message)
Instantiates a new Object of typeProtocolException
.- Parameters:
message
- Message to be thrown with the exception.
-
ProtocolException
public ProtocolException(java.lang.String message, java.net.HttpURLConnection connection)
Instantiates a new Object of typeProtocolException
.- Parameters:
message
- Message to be thrown with the exception.connection
-HttpURLConnection
, where the error occurred.
-
-
Method Detail
-
getCausingConnection
public java.net.HttpURLConnection 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.
-
-