Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.HttpURLConnection getCausingConnection()
      Returns the HttpURLConnection instances, which caused the error.
      boolean shouldRetry()
      Determines whether a retry attempt should be made after a ProtocolException or not.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProtocolException

        public ProtocolException​(java.lang.String message)
        Instantiates a new Object of type ProtocolException.
        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 type ProtocolException.
        Parameters:
        message - Message to be thrown with the exception.
        connection - HttpURLConnection, where the error occurred.
    • Method Detail

      • getCausingConnection

        public java.net.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.