From 615e823ca249c828ba0b8fadf3f1cd8d0b89796a Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 27 Mar 2024 17:02:51 +0100 Subject: [PATCH] Include more details in the UnsupportedMessageTypeException when thrown Motivation: Let's include some more details about why this exception was thrown and what we expected. Modifications: Use other constructor which will provide some useful informations Result: Easier to debug --- .../incubator/codec/http3/Http3FrameToHttpObjectCodec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/netty/incubator/codec/http3/Http3FrameToHttpObjectCodec.java b/src/main/java/io/netty/incubator/codec/http3/Http3FrameToHttpObjectCodec.java index c7b5058..33bce51 100644 --- a/src/main/java/io/netty/incubator/codec/http3/Http3FrameToHttpObjectCodec.java +++ b/src/main/java/io/netty/incubator/codec/http3/Http3FrameToHttpObjectCodec.java @@ -134,7 +134,7 @@ protected void channelInputClosed(ChannelHandlerContext ctx) throws Exception { @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (!(msg instanceof HttpObject)) { - throw new UnsupportedMessageTypeException(); + throw new UnsupportedMessageTypeException(msg, HttpObject.class); } // 100-continue is typically a FullHttpResponse, but the decoded // Http3HeadersFrame should not handles as a end of stream.