annanys23 commented on code in PR #7929:
URL: https://github.com/apache/nifi/pull/7929#discussion_r1374757819


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java:
##########
@@ -296,6 +298,18 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
             } else {
                 attributes.put(CoreAttributes.FILENAME.key(), filename);
             }
+
+            if (failureRelationship != null) {
+                attributes.put(FAILURE_REASON_ATTRIBUTE, 
failureRelationship.getName());
+                flowFile = session.putAllAttributes(flowFile, attributes);
+                session.transfer(session.penalize(flowFile), 
failureRelationship);
+                if (provenanceEventOnFailure) {
+                    session.getProvenanceReporter().route(flowFile, 
failureRelationship);
+                }
+                cleanupTransfer(transfer, closeConnOnFailure, transferQueue, 
host, port);
+                return;
+            }

Review Comment:
   Yes, this was intentional.  I would think the other attributes are needed 
for a follow on processor to have context (ex: generate email notifications 
with similar content to what is being logged in the catch blocks).  Also, this 
was meant to remove some redundant code.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to