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/02/13 21:55:55 UTC

[GitHub] [nifi] shawnweeks commented on a change in pull request #4052: NIFI-7139 Add record.error.message on failure of a record reader or w…

shawnweeks commented on a change in pull request #4052: NIFI-7139 Add record.error.message on failure of a record reader or w…
URL: https://github.com/apache/nifi/pull/4052#discussion_r379141142
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java
 ##########
 @@ -174,6 +174,7 @@ public void process(final InputStream in, final OutputStream out) throws IOExcep
             });
         } catch (final Exception e) {
             getLogger().error("Failed to process {}; will route to failure", new Object[] {flowFile, e});
+            session.putAttribute(flowFile,"record.error.message",e.getCause().getLocalizedMessage());
 
 Review comment:
   We're wrapping both exceptions directly above here so I think they're should always be a cause but it's possible the message might be null.

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


With regards,
Apache Git Services