Home / Function/ onStreamError() — netty Function Reference

onStreamError() — netty Function Reference

Architecture documentation for the onStreamError() function in Http2FrameCodec.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1a1676e6_9f4d_15dc_7bf4_95b745c05c57["onStreamError()"]
  ba77a225_4637_fe77_ee1f_54a9774ca7f8["Http2FrameCodec"]
  1a1676e6_9f4d_15dc_7bf4_95b745c05c57 -->|defined in| ba77a225_4637_fe77_ee1f_54a9774ca7f8
  72d7b453_4a19_1b18_852e_1691b32b0f44["onHttp2UnknownStreamError()"]
  1a1676e6_9f4d_15dc_7bf4_95b745c05c57 -->|calls| 72d7b453_4a19_1b18_852e_1691b32b0f44
  f86f70ef_9f82_85ae_5a8c_77a20382f851["onHttp2FrameStreamException()"]
  1a1676e6_9f4d_15dc_7bf4_95b745c05c57 -->|calls| f86f70ef_9f82_85ae_5a8c_77a20382f851
  style 1a1676e6_9f4d_15dc_7bf4_95b745c05c57 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java lines 548–572

    @Override
    protected final void onStreamError(ChannelHandlerContext ctx, boolean outbound, Throwable cause,
                                       Http2Exception.StreamException streamException) {
        int streamId = streamException.streamId();
        Http2Stream connectionStream = connection().stream(streamId);
        if (connectionStream == null) {
            onHttp2UnknownStreamError(ctx, cause, streamException);
            // Write a RST_STREAM
            super.onStreamError(ctx, outbound, cause, streamException);
            return;
        }

        Http2FrameStream stream = connectionStream.getProperty(streamKey);
        if (stream == null) {
            LOG.warn("{} Stream exception thrown without stream object attached.", ctx.channel(), cause);
            // Write a RST_STREAM
            super.onStreamError(ctx, outbound, cause, streamException);
            return;
        }

        if (!outbound) {
            // We only forward non outbound errors as outbound errors will already be reflected by failing the promise.
            onHttp2FrameStreamException(ctx, new Http2FrameStreamException(stream, streamException.error(), cause));
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does onStreamError() do?
onStreamError() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java.
Where is onStreamError() defined?
onStreamError() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java at line 548.
What does onStreamError() call?
onStreamError() calls 2 function(s): onHttp2FrameStreamException, onHttp2UnknownStreamError.

Analyze Your Own Codebase

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

Try Supermodel Free