Enum GrpcUtil.Http2Error

java.lang.Object
java.lang.Enum<GrpcUtil.Http2Error>
io.grpc.internal.GrpcUtil.Http2Error
All Implemented Interfaces:
Serializable, Comparable<GrpcUtil.Http2Error>
Enclosing class:
GrpcUtil

public static enum GrpcUtil.Http2Error extends Enum<GrpcUtil.Http2Error>
All error codes identified by the HTTP/2 spec. Used in GOAWAY and RST_STREAM frames.
  • Enum Constant Details

  • Field Details

    • codeMap

      private static final GrpcUtil.Http2Error[] codeMap
    • code

      private final int code
    • status

      private final Status status
  • Constructor Details

    • Http2Error

      private Http2Error(int code, Status status)
  • Method Details

    • values

      public static GrpcUtil.Http2Error[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static GrpcUtil.Http2Error valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • buildHttp2CodeMap

      private static GrpcUtil.Http2Error[] buildHttp2CodeMap()
    • code

      public long code()
      Gets the code for this error used on the wire.
    • status

      public Status status()
      Gets the Status associated with this HTTP/2 code.
    • forCode

      public static GrpcUtil.Http2Error forCode(long code)
      Looks up the HTTP/2 error code enum value for the specified code.
      Parameters:
      code - an HTTP/2 error code value.
      Returns:
      the HTTP/2 error code enum or null if not found.
    • statusForCode

      public static Status statusForCode(long code)
      Looks up the Status from the given HTTP/2 error code. This is preferred over forCode(code).status(), to more easily conform to HTTP/2:
      Unknown or unsupported error codes MUST NOT trigger any special behavior. These MAY be treated by an implementation as being equivalent to INTERNAL_ERROR.
      Parameters:
      code - the HTTP/2 error code.
      Returns:
      a Status representing the given error.