You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/11/25 18:25:31 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #4686: NIFI-8036: Adding es.failure.reason to PutHttpProcessor

exceptionfactory commented on a change in pull request #4686:
URL: https://github.com/apache/nifi/pull/4686#discussion_r530569380



##########
File path: nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchHttp.java
##########
@@ -356,6 +363,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                                             errorReason = reason;
                                             logger.error("Failed to process {} due to {}, transferring to failure",
                                                     new Object[]{flowFile, errorReason});
+                                            flowFile = session.putAttribute(flowFile, "es.failure.reason", errorReason);

Review comment:
       Reviewing this line in comparison to line 369, is there any difference between the `es.failure.reason` and `reason` attributes?  If the values are the same in practice, then perhaps just updating the WritesAttribute annotation to add the `reason` attribute would be helpful.
   
   As listed in the PR checklist, introducing a unit test to evaluate the presence of the attribute on failure would also be useful.




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

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