Class ProtocolException

java.lang.Object
java.lang.Throwable
java.lang.Exception
io.tus.java.client.ProtocolException
All Implemented Interfaces:
Serializable

public class ProtocolException extends Exception
This exception is thrown if the server sends a request with an unexpected status code or missing/invalid headers.
See Also:
  • Constructor Details

    • ProtocolException

      public ProtocolException(String message)
      Instantiates a new Object of type ProtocolException.
      Parameters:
      message - Message to be thrown with the exception.
    • ProtocolException

      public ProtocolException(String message, HttpURLConnection connection)
      Instantiates a new Object of type ProtocolException.
      Parameters:
      message - Message to be thrown with the exception.
      connection - HttpURLConnection, where the error occurred.
  • Method Details

    • getCausingConnection

      public HttpURLConnection getCausingConnection()
      Returns the HttpURLConnection instances, which caused the error.
      Returns:
      HttpURLConnection
    • shouldRetry

      public boolean shouldRetry()
      Determines whether a retry attempt should be made after a ProtocolException or not.
      Returns:
      true if there should be a retry attempt.