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
507e0a05b5
commit
dea4e33c52
@ -1164,7 +1164,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
|
||||||
@ -1180,7 +1179,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
|
||||||
@ -1196,7 +1194,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