Skip to content

Commit

Permalink
Include more details in the UnsupportedMessageTypeException when thrown
Browse files Browse the repository at this point in the history
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
  • Loading branch information
normanmaurer committed Mar 27, 2024
1 parent 18fd091 commit 615e823
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 615e823

Please sign in to comment.