Search in sources :

Example 1 with CompositeStreamException

use of io.netty.handler.codec.http2.Http2Exception.CompositeStreamException in project netty by netty.

the class Http2ConnectionHandler method onError.

/**
     * Central handler for all exceptions caught during HTTP/2 processing.
     */
@Override
public void onError(ChannelHandlerContext ctx, Throwable cause) {
    Http2Exception embedded = getEmbeddedHttp2Exception(cause);
    if (isStreamError(embedded)) {
        onStreamError(ctx, cause, (StreamException) embedded);
    } else if (embedded instanceof CompositeStreamException) {
        CompositeStreamException compositException = (CompositeStreamException) embedded;
        for (StreamException streamException : compositException) {
            onStreamError(ctx, cause, streamException);
        }
    } else {
        onConnectionError(ctx, cause, embedded);
    }
    ctx.flush();
}
Also used : Http2CodecUtil.getEmbeddedHttp2Exception(io.netty.handler.codec.http2.Http2CodecUtil.getEmbeddedHttp2Exception) CompositeStreamException(io.netty.handler.codec.http2.Http2Exception.CompositeStreamException) StreamException(io.netty.handler.codec.http2.Http2Exception.StreamException) CompositeStreamException(io.netty.handler.codec.http2.Http2Exception.CompositeStreamException)

Aggregations

Http2CodecUtil.getEmbeddedHttp2Exception (io.netty.handler.codec.http2.Http2CodecUtil.getEmbeddedHttp2Exception)1 CompositeStreamException (io.netty.handler.codec.http2.Http2Exception.CompositeStreamException)1 StreamException (io.netty.handler.codec.http2.Http2Exception.StreamException)1