Home / Class/ Http2Exception Class — netty Architecture

Http2Exception Class — netty Architecture

Architecture documentation for the Http2Exception class in Http2Exception.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  773ff5e4_c053_face_faa5_20d7b4530e9c["Http2Exception"]
  7dd7718e_f2a2_dc12_a584_d41785aa4a88["Http2Exception.java"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|defined in| 7dd7718e_f2a2_dc12_a584_d41785aa4a88
  bc22a7e1_429c_5d1b_6d50_11ed82b465f6["Http2Exception()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| bc22a7e1_429c_5d1b_6d50_11ed82b465f6
  31d7a16f_63f4_1948_9ec4_83a58e9e2aa4["Http2Error()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| 31d7a16f_63f4_1948_9ec4_83a58e9e2aa4
  74303090_a681_d2b5_5b0d_b35fb058e80d["ShutdownHint()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| 74303090_a681_d2b5_5b0d_b35fb058e80d
  8edf267c_ea4a_8472_95ce_5019708841d0["String()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| 8edf267c_ea4a_8472_95ce_5019708841d0
  ad8d0b08_2b93_7e03_f103_597e6dd6160b["isStreamError()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| ad8d0b08_2b93_7e03_f103_597e6dd6160b
  cac5722b_13f0_c2c9_032f_ae3744840bec["streamId()"]
  773ff5e4_c053_face_faa5_20d7b4530e9c -->|method| cac5722b_13f0_c2c9_032f_ae3744840bec

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java lines 31–333

public class Http2Exception extends Exception {
    private static final long serialVersionUID = -6941186345430164209L;
    private final Http2Error error;
    private final ShutdownHint shutdownHint;

    public Http2Exception(Http2Error error) {
        this(error, ShutdownHint.HARD_SHUTDOWN);
    }

    public Http2Exception(Http2Error error, ShutdownHint shutdownHint) {
        this.error = checkNotNull(error, "error");
        this.shutdownHint = checkNotNull(shutdownHint, "shutdownHint");
    }

    public Http2Exception(Http2Error error, String message) {
        this(error, message, ShutdownHint.HARD_SHUTDOWN);
    }

    public Http2Exception(Http2Error error, String message, ShutdownHint shutdownHint) {
        super(message);
        this.error = checkNotNull(error, "error");
        this.shutdownHint = checkNotNull(shutdownHint, "shutdownHint");
    }

    public Http2Exception(Http2Error error, String message, Throwable cause) {
        this(error, message, cause, ShutdownHint.HARD_SHUTDOWN);
    }

    public Http2Exception(Http2Error error, String message, Throwable cause, ShutdownHint shutdownHint) {
        super(message, cause);
        this.error = checkNotNull(error, "error");
        this.shutdownHint = checkNotNull(shutdownHint, "shutdownHint");
    }

    static Http2Exception newStatic(Http2Error error, String message, ShutdownHint shutdownHint,
                                    Class<?> clazz, String method) {
        final Http2Exception exception = new StacklessHttp2Exception(error, message, shutdownHint, true);
        return ThrowableUtil.unknownStackTrace(exception, clazz, method);
    }

    private Http2Exception(Http2Error error, String message, ShutdownHint shutdownHint, boolean shared) {
        super(message, null, false, true);
        assert shared;
        this.error = checkNotNull(error, "error");
        this.shutdownHint = checkNotNull(shutdownHint, "shutdownHint");
    }

    public Http2Error error() {
        return error;
    }

    /**
     * Provide a hint as to what type of shutdown should be executed. Note this hint may be ignored.
     */
    public ShutdownHint shutdownHint() {
        return shutdownHint;
    }

    /**
     * Use if an error has occurred which can not be isolated to a single stream, but instead applies
     * to the entire connection.
     * @param error The type of error as defined by the HTTP/2 specification.
     * @param fmt String with the content and format for the additional debug data.
     * @param args Objects which fit into the format defined by {@code fmt}.
     * @return An exception which can be translated into an HTTP/2 error.
     */
    public static Http2Exception connectionError(Http2Error error, String fmt, Object... args) {
        return new Http2Exception(error, formatErrorMessage(fmt, args));
    }

    /**
     * Use if an error has occurred which can not be isolated to a single stream, but instead applies
     * to the entire connection.
     * @param error The type of error as defined by the HTTP/2 specification.
     * @param cause The object which caused the error.
     * @param fmt String with the content and format for the additional debug data.
     * @param args Objects which fit into the format defined by {@code fmt}.
     * @return An exception which can be translated into an HTTP/2 error.
     */
    public static Http2Exception connectionError(Http2Error error, Throwable cause,
            String fmt, Object... args) {

Frequently Asked Questions

What is the Http2Exception class?
Http2Exception is a class in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java.
Where is Http2Exception defined?
Http2Exception is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java at line 31.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free