code: protected void onStreamError(ChannelHandlerContext ctx, boolean outbound,
                                   @SuppressWarnings("unused") Throwable cause, StreamException http2Ex) {
          final int streamId = http2Ex.streamId();
          Http2Stream stream = connection().stream(streamId);
  
          //if this is caused by reading headers that are too large, send a header with status 431
          if (http2Ex instanceof Http2Exception.HeaderListSizeException &&
              ((Http2Exception.HeaderListSizeException) http2Ex).duringDecode() &&
              connection().isServer()) {
  
              // NOTE We have to check to make sure that a stream exists before we send our reply.
              // We likely always create the stream below as the stream isn't created until the
              // header block is completely processed.
  
              // The case of a streamId referring to a stream which was already closed is handled
              // by createStream and will land us in the catch block below
              if (stream == null) {
                  try {
                      stream = encoder.connection().remote().createStream(streamId, true);
                  } catch (Http2Exception e) {
                      resetUnknownStream(ctx, streamId, http2Ex.error().code(), ctx.newPromise());
                      return;
                  }
              }
  
              // ensure that we have not already sent headers on this stream
              if (stream != null && !stream.isHeadersSent()) {
                  try {
                      handleServerHeaderDecodeSizeError(ctx, stream);
                  } catch (Throwable cause2) {
                      onError(ctx, outbound, connectionError(INTERNAL_ERROR, cause2, "Error DecodeSizeError"));
                  }
              }
          }
  
          if (stream == null) {
              if (!outbound || connection().local().mayHaveCreatedStream(streamId)) {
                  resetUnknownStream(ctx, streamId, http2Ex.error().code(), ctx.newPromise());
              }
          } else {
              resetStream(ctx, stream, http2Ex.error().code(), ctx.newPromise());
          }
      }
docs: Handler for a stream error. Sends a {@code RST_STREAM} frame to the remote endpoint and closes the
  stream.
  
  @param ctx the channel context
  @param outbound {@code true} if the error was caused by an outbound operation.
  @param cause the exception that was caught
  @param http2Ex the {@link StreamException} that is embedded in the causality chain.