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:
[email protected]
With regards,
Apache Git Services