jonmeredith commented on code in PR #2104:
URL: https://github.com/apache/cassandra/pull/2104#discussion_r1136206918
##########
src/java/org/apache/cassandra/streaming/StreamSession.java:
##########
@@ -694,8 +701,8 @@ public Future<?> onError(Throwable e)
state(State.FAILED); // make sure subsequent error handling sees
the session in a final state
channel.sendControlMessage(new
SessionFailedMessage()).awaitUninterruptibly();
}
-
- return closeSession(State.FAILED);
+ StringBuilder boundedThrowable = boundStackTrace(e, 2); //bound the
stacktrace with a specified limit on the number of lines
+ return closeSession(State.FAILED, "Failed because of an unkown
exception\n" + boundedThrowable);
Review Comment:
Shame to use a StringBuilder and then use a concatenation.
What if you provided the StringBuilder to `boundStackTrace`
```suggestion
StringBuilder reason = StringBuilder("Failed because of an unknown
exception\n");
boundStackTrace(reason, e, 2); //bound the stacktrace with a
specified limit on the number of lines
return closeSession(State.FAILED, reason.toString());
```
(Also `unkown` typo)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]