Class Http2Exception

    • Method Detail

      • shutdownHint

        public Http2Exception.ShutdownHint shutdownHint()
        Provide a hint as to what type of shutdown should be executed. Note this hint may be ignored.
      • connectionError

        public static Http2Exception connectionError​(Http2Error error,
                                                     java.lang.String fmt,
                                                     java.lang.Object... args)
        Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.
        Parameters:
        error - The type of error as defined by the HTTP/2 specification.
        fmt - String with the content and format for the additional debug data.
        args - Objects which fit into the format defined by fmt.
        Returns:
        An exception which can be translated into an HTTP/2 error.
      • connectionError

        public static Http2Exception connectionError​(Http2Error error,
                                                     java.lang.Throwable cause,
                                                     java.lang.String fmt,
                                                     java.lang.Object... args)
        Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.
        Parameters:
        error - The type of error as defined by the HTTP/2 specification.
        cause - The object which caused the error.
        fmt - String with the content and format for the additional debug data.
        args - Objects which fit into the format defined by fmt.
        Returns:
        An exception which can be translated into an HTTP/2 error.
      • closedStreamError

        public static Http2Exception closedStreamError​(Http2Error error,
                                                       java.lang.String fmt,
                                                       java.lang.Object... args)
        Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.
        Parameters:
        error - The type of error as defined by the HTTP/2 specification.
        fmt - String with the content and format for the additional debug data.
        args - Objects which fit into the format defined by fmt.
        Returns:
        An exception which can be translated into an HTTP/2 error.
      • streamError

        public static Http2Exception streamError​(int id,
                                                 Http2Error error,
                                                 java.lang.Throwable cause,
                                                 java.lang.String fmt,
                                                 java.lang.Object... args)
        Use if an error which can be isolated to a single stream has occurred. If the id is not Http2CodecUtil.CONNECTION_STREAM_ID then a Http2Exception.StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
        Parameters:
        id - The stream id for which the error is isolated to.
        error - The type of error as defined by the HTTP/2 specification.
        cause - The object which caused the error.
        fmt - String with the content and format for the additional debug data.
        args - Objects which fit into the format defined by fmt.
        Returns:
        If the id is not Http2CodecUtil.CONNECTION_STREAM_ID then a Http2Exception.StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
      • headerListSizeError

        public static Http2Exception headerListSizeError​(int id,
                                                         Http2Error error,
                                                         boolean onDecode,
                                                         java.lang.String fmt,
                                                         java.lang.Object... args)
        A specific stream error resulting from failing to decode headers that exceeds the max header size list. If the id is not Http2CodecUtil.CONNECTION_STREAM_ID then a Http2Exception.StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
        Parameters:
        id - The stream id for which the error is isolated to.
        error - The type of error as defined by the HTTP/2 specification.
        onDecode - Whether this error was caught while decoding headers
        fmt - String with the content and format for the additional debug data.
        args - Objects which fit into the format defined by fmt.
        Returns:
        If the id is not Http2CodecUtil.CONNECTION_STREAM_ID then a Http2Exception.HeaderListSizeException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
      • isStreamError

        public static boolean isStreamError​(Http2Exception e)
        Check if an exception is isolated to a single stream or the entire connection.
        Parameters:
        e - The exception to check.
        Returns:
        true if e is an instance of Http2Exception.StreamException. false otherwise.
      • streamId

        public static int streamId​(Http2Exception e)
        Get the stream id associated with an exception.
        Parameters:
        e - The exception to get the stream id for.
        Returns:
        Http2CodecUtil.CONNECTION_STREAM_ID if e is a connection error. Otherwise the stream id associated with the stream error.