jrsteinebrey commented on code in PR #10366:
URL: https://github.com/apache/nifi/pull/10366#discussion_r2399207004


##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/avro/WriteAvroResultWithSchema.java:
##########
@@ -58,7 +58,11 @@ public void flush() throws IOException {
     @Override
     public Map<String, String> writeRecord(final Record record) throws 
IOException {
         final GenericRecord rec = AvroTypeUtil.createAvroRecord(record, 
schema);
-        dataFileWriter.append(rec);
+        try {
+            dataFileWriter.append(rec);
+        } catch (final DataFileWriter.AppendWriteException e) {
+            throw new IOException(e);

Review Comment:
   Thanks for working on this ticket. 
   This changed line breaks other writeRecord() callers who explicitly catch 
DataFileWriter.AppendWriteException like this example
   
https://github.com/jrsteinebrey/nifi/blob/b0f29ef94e95be8160ec2cd5fbdfbef373451f90/nifi-extension-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java#L466
   They would need to be changed to catch IOException instead of 
AppendWriteException. 
   Instead of this change here in WriteAvroResultWithSchema.java,
   I suggest that you consider changing the Kafka code here 
   
https://github.com/apache/nifi/blob/1457950040d0fe86ade53770def6c5a95b6f0252/nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/consumer/convert/AbstractRecordStreamKafkaMessageConverter.java#L112-L120\
   to catch (Exception) instead of specific exception classes. Then the ticket 
is resolved and any future created  exception classes also route to failure.
   



-- 
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]

Reply via email to