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 Type
    Method
    Description
    void
    channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    forConnection(org.mockserver.logging.MockServerLogger mockServerLogger, org.mockserver.configuration.Configuration configuration, ClientTlsHandshakeFailureLog clientTlsHandshakeFailureLog)
     
    void
    userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
     

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
    • userEventTriggered

      public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
      Specified by:
      userEventTriggered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter