(versione: Netty 4.0.4.Final)Perché le eccezioni di ChannelOutboundHandler non vengono rilevate dal metodo exceptionCaught()? (Netty 4.0.4.Final)
Se un'eccezione sorge in ChannelInboundHandler
, posso gestire in exceptionCaught()
metodo, ma se l'eccezione sorge in ChannelOutboundHandler
, non ci riesco . Perché, exceptionCaught()
non è una chiamata. Perché è così?
C'è un solo modo per gestire eccezione in uscita dal risultato Analize Future in questo modo:
channel.writeAndFlush(serverPacket).addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
future.cause().printStackTrace();
}
}
});
Ma è molto scomodo.