soarez commented on code in PR #15701: URL: https://github.com/apache/kafka/pull/15701#discussion_r1574584174
########## metadata/src/main/java/org/apache/kafka/controller/errors/EventHandlerExceptionInfo.java: ########## @@ -191,6 +191,10 @@ public String failureMessage( } } bld.append("."); + if (!isFault && internalException.getMessage() != null) { + bld.append(" Detailed exception message: "); Review Comment: The "Detailed " bit seems unecessary, maybe just "Exception message: "? ########## metadata/src/test/java/org/apache/kafka/controller/errors/EventHandlerExceptionInfoTest.java: ########## @@ -174,10 +180,18 @@ public void testUnexpectedBaseOffsetExceptionInfo() { public void testUnexpectedBaseOffsetFailureMessage() { assertEquals("event failed with UnexpectedBaseOffsetException (treated as " + "NotControllerException) at epoch 123 in 90 microseconds. Renouncing leadership " + - "and reverting to the last committed offset 456.", + "and reverting to the last committed offset 456. Detailed exception message: Wanted base offset 3, but the next offset was 4", UNEXPECTED_END_OFFSET.failureMessage(123, OptionalLong.of(90L), true, 456L)); } + @Test + public void testKafkaExceptionFailureMessage() { Review Comment: Should we make it clear we're testing the "isFault" case here in the test name? Perhaps `testFaultExceptionFailureMessage`? ########## metadata/src/test/java/org/apache/kafka/controller/errors/EventHandlerExceptionInfoTest.java: ########## @@ -72,6 +73,11 @@ public class EventHandlerExceptionInfoTest { new TimeoutException(), () -> OptionalInt.of(1)); + private static final EventHandlerExceptionInfo KAFKA_EXCEPTION = + EventHandlerExceptionInfo.fromInternal( + new KafkaException("Custom kafka exception message"), + () -> OptionalInt.of(1)); + Review Comment: It seems this is only used in `testKafkaExceptionFailureMessage`, can we move it there? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org