Class HTTP2ConnectionError

All Implemented Interfaces:
Serializable

public class HTTP2ConnectionError extends HTTPException
Represents a HTTP/2 connection or stream error.
Since:
1.2.1
See Also:
API Note:
Despite the name, this class is an Exception (specifically a HTTPException) not an Error. The name was chosen to align more closely with the terms used in the specification.
  • Constructor Details

    • HTTP2ConnectionError

      public HTTP2ConnectionError(int status)
      Creates a new HTTP2ConnectionError, as a connection error.
      Parameters:
      status - The status code
    • HTTP2ConnectionError

      public HTTP2ConnectionError(int status, boolean streamError)
      Creates a new HTTP2ConnectionError.
      Parameters:
      status - The status code
      streamError - Whether this instance represents a stream or connection error
    • HTTP2ConnectionError

      public HTTP2ConnectionError(int status, String msg)
      Creates a new HTTP2ConnectionError, as a connection error with the given message.
      Parameters:
      status - The status code
      msg - The error message
    • HTTP2ConnectionError

      public HTTP2ConnectionError(int status, boolean streamError, String msg)
      Creates a new HTTP2ConnectionError with the given message.
      Parameters:
      status - The status code
      streamError - Whether this instance represents a stream or connection error
      msg - The error message
  • Method Details

    • getStatus

      public int getStatus()
      Returns the status code passed in the constructor.
      Returns:
      The status code
    • isStreamError

      public boolean isStreamError()
      Returns whether this instance represents a stream or connection error, as configured in the constructor.
      Returns:
      true if this instance represents a stream error
    • getStatusCodeName

      public static String getStatusCodeName(int status)
      Returns a string of the format NAME [NUMBER], where NAME is the string name of the given status code, and NUMBER is the given status code number.
      Parameters:
      status - The status code
      Returns:
      The string