question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to capture DecoderException (`TooLongHttpLineException`)

See original GitHub issue

Expected behavior

Be able to capture DecodeExceptions (example TooLongHttpLineException) in a similar way other exceptions can be captured, like ChannelInboundHandler.exceptionCaught.

Actual behavior

Based on what I 've seen, exceptions happening in HttpObjectDecoder like this https://github.com/netty/netty/blob/5256f3628c553081e674f7b27e93a97350141715/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java#L973-L985 are just swallowed in:

Steps to reproduce

Minimal yet complete reproducer code (or URL to code)

See https://github.com/abelsromero/netty-runner

Netty version

1.0.22

JVM version (e.g. java -version)

openjdk version “17.0.3.1” 2022-04-22 LTS

OS version (e.g. uname -a)

Darwin romeroab-a01.vmware.com 21.5.0 Darwin Kernel Version 21.5.0 root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
abelsromerocommented, Sep 5, 2022

Thanks a lot! I could finally make it work with (updated the reproducer with a new commit with it)

		@Override
		public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
			if (msg instanceof DecoderResultProvider request) {
				DecoderResult decoderResult = request.decoderResult();
				if (decoderResult.isFailure()) {
					Throwable cause = decoderResult.cause();
					System.out.println(cause);
				}
			}
			super.channelRead(ctx, msg);
		}
1reaction
violetaggcommented, Sep 2, 2022

@abelsromero I’ll encourage you to ask your question here https://gitter.im/reactor/reactor-netty

Read more comments on GitHub >

github_iconTop Results From Across the Web

TooLongHttpLineException (Netty API Reference (4.1.85.Final))
Class TooLongHttpLineException · java.lang.Object · java.lang.Throwable · java.lang.Exception · java.lang.RuntimeException · io.netty.handler.codec.CodecException.
Read more >
Can't join modded server (1.19) (io.netty.handler.codec ...
I get this error when trying to connect: I've already gone through the newly added mods one by one to see which one...
Read more >
java.lang.RuntimeException: Failed to deserialize ingredient ...
DecoderException : java.lang.RuntimeException: Failed to deserialize ingredient! Expected a marker with value '601817315' or '-104387951'.
Read more >
Netty Decoding Error - java - Stack Overflow
Whenever the channel is inactive decode will be called this is the default behavior inherited from ByteToMessageDecoder, to solve this ...
Read more >
Unable to get into server. "Internal Exception: Io.netty.Handler ...
netty.Handler.codec.decoderexception: java.IOException: Bad Packet id 26. English; Java Edition.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found