Package org.mockserver.netty.http3
Class Http3ExceptionHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.mockserver.netty.http3.Http3ExceptionHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable
public class Http3ExceptionHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
The last handler of an HTTP/3 connection's pipeline. It logs each exception that reaches the end of that pipeline
once, at the level its cause calls for, where Netty would log every one at
WARN with a stack trace through
its own logger. It does the same for the streams Netty's HTTP/3 codec keeps for itself, the client's control and
QPACK streams, by adding a handler to each as the client opens it. The streams MockServer's side opens cannot be
reached, so on the client's control stream it keeps the SETTINGS within what Netty's QPACK encoder accepts.
It closes nothing but a channel that met Netty's direct memory limit: Netty closes the connection for a failed handshake, a QUIC error and an HTTP/3 connection error, and neither a stream its client reset nor a frame Netty could not decode closed anything before.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) static Http3ExceptionHandlerforConnection(org.mockserver.logging.MockServerLogger mockServerLogger, org.mockserver.configuration.Configuration configuration, ClientTlsHandshakeFailureLog clientTlsHandshakeFailureLog) voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Method Details
-
forConnection
public static Http3ExceptionHandler forConnection(org.mockserver.logging.MockServerLogger mockServerLogger, org.mockserver.configuration.Configuration configuration, ClientTlsHandshakeFailureLog clientTlsHandshakeFailureLog) - Returns:
- the handler for a QUIC connection's pipeline, where it must stay last
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
userEventTriggered
- Specified by:
userEventTriggeredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
userEventTriggeredin classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-