views:

113

answers:

2

Hello Experts,

could someone please explain to me, how in netty "Downstream Exceptions" are handeled? According to the javadoc there are no Downstream exceptions:

http://docs.jboss.org/netty/3.1/api/org/jboss/netty/channel/ExceptionEvent.html

Given the case that in one of my downstream handlers an exception occures OR in the I/0 Thread itself, where can these errors be catched and handeled?

thank you very much tom

A: 

It looks like SimpleChannelDownstreamHandler doesn't have any exception handling method, as you say. Could you rather use a plain old SimpleChannelHandler, and use a downstream method, like writeRequested(...)? (That is, just move your code to that method). Then you could use exceptionCaught(...) when it throws an exception.

djb
A: 

If an exception is raised in your handler, it always triggers an upstream exception event. It doesn't matter if the exception was raised by an upstream or a downstream handler.

Trustin Lee