Don't double record stacktrace in Annotated*Exception (#9117)
Motivation: When initializing the AnnotatedSocketException in AbstractChannel, both the cause and the stack trace are set, leaving a trailing "Caused By" that is compressed when printing the trace. Modification: Don't include the stack trace in the exception, but leave it in the cause. Result: Clearer stack trace
This commit is contained in:
parent
d29f91540d
commit
912aa7d867
@ -1112,7 +1112,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
AnnotatedConnectException(ConnectException exception, SocketAddress remoteAddress) {
|
AnnotatedConnectException(ConnectException exception, SocketAddress remoteAddress) {
|
||||||
super(exception.getMessage() + ": " + remoteAddress);
|
super(exception.getMessage() + ": " + remoteAddress);
|
||||||
initCause(exception);
|
initCause(exception);
|
||||||
setStackTrace(exception.getStackTrace());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1128,7 +1127,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
AnnotatedNoRouteToHostException(NoRouteToHostException exception, SocketAddress remoteAddress) {
|
AnnotatedNoRouteToHostException(NoRouteToHostException exception, SocketAddress remoteAddress) {
|
||||||
super(exception.getMessage() + ": " + remoteAddress);
|
super(exception.getMessage() + ": " + remoteAddress);
|
||||||
initCause(exception);
|
initCause(exception);
|
||||||
setStackTrace(exception.getStackTrace());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1144,7 +1142,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
AnnotatedSocketException(SocketException exception, SocketAddress remoteAddress) {
|
AnnotatedSocketException(SocketException exception, SocketAddress remoteAddress) {
|
||||||
super(exception.getMessage() + ": " + remoteAddress);
|
super(exception.getMessage() + ": " + remoteAddress);
|
||||||
initCause(exception);
|
initCause(exception);
|
||||||
setStackTrace(exception.getStackTrace());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user