cadonna commented on code in PR #16300: URL: https://github.com/apache/kafka/pull/16300#discussion_r1686587201
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java: ########## @@ -913,10 +918,30 @@ public void punctuate(final ProcessorNode<?, ?, ?, ?> node, try { maybeMeasureLatency(() -> node.punctuate(timestamp, punctuator), time, punctuateLatencySensor); - } catch (final StreamsException e) { - throw e; } catch (final RuntimeException e) { - throw new StreamsException(String.format("%sException caught while punctuating processor '%s'", logPrefix, node.name()), e); + final ErrorHandlerContext errorHandlerContext = new DefaultErrorHandlerContext( + recordContext.topic(), + recordContext.partition(), + recordContext.offset(), + recordContext.headers(), + null, + null, + node.name(), + id + ); + final ProcessingExceptionHandler.ProcessingHandlerResponse response = processingExceptionHandler + .handle(errorHandlerContext, null, e); + + if (response == ProcessingExceptionHandler.ProcessingHandlerResponse.FAIL) { + log.error("Processing exception handler is set to fail upon" + + " a processing error. If you would rather have the streaming pipeline" + + " continue after a processing error, please set the " + + PROCESSING_EXCEPTION_HANDLER_CLASS_CONFIG + " appropriately."); + + throw e instanceof StreamsException ? (StreamsException) e : new StreamsException(String.format("%sException caught while punctuating processor '%s'", logPrefix, node.name()), e); Review Comment: nit: ```suggestion throw e instanceof StreamsException ? e : new StreamsException(String.format("%sException caught while punctuating processor '%s'", logPrefix, node.name()), e); ``` -- 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