[Q/A][Java SDK (Component)] xxx The exceptionCought #16062
Unanswered
LI123456mo
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-check
Apache Dubbo Component
Java SDK (apache/dubbo)
Details
What is the difference in using this
@OverRide
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
Channel ch = ctx.channel();
NettyChannel channel = NettyChannel.getOrAddChannel(ch, url, handler);
try {
handler.caught(channel, cause);
} finally {
NettyChannel.removeChannelIfDisconnected(ch);
}
and using this (I found it while walking through netty )
@OverRide
public void exceptionCaught(ChannelHandlerContext ctx,Throwable cause) {
cause.printStackTrace();
ctx.close();
}
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions