Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1290#discussion_r90893970
  
    --- Diff: 
nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java
 ---
    @@ -196,8 +196,8 @@ public void process(final InputStream in) throws 
IOException {
                 final Map<String, String> attributes = getAttributes(message, 
useSegmentNames, parseSegmentFields);
                 flowFile = session.putAllAttributes(flowFile, attributes);
                 getLogger().debug("Added the following attributes for {}: {}", 
new Object[]{flowFile, attributes});
    -        } catch (final HL7Exception e) {
    -            getLogger().error("Failed to extract attributes from {} due to 
{}", new Object[]{flowFile, e});
    +        } catch (final Throwable t) {
    --- End diff --
    
    Do you have an example / reproduction path of an exception that isn't an 
HL7Exception? I'm a bit wary of changing this to Throwable as the error might 
have come from the NiFi framework, and routing any possible error to a block 
that transfers a flow file might not be the best idea. If the callback passed 
to session.read() throws an IOException, then read() will throw a 
ProcessException with the IOException as the cause. You could check for that 
possibility, or (since you are just filling a buffer in the callback) you could 
retrieve the InputStream using 
[session.read(flowFile)](https://github.com/apache/nifi/blob/master/nifi-api/src/main/java/org/apache/nifi/processor/ProcessSession.java#L570)
 then call StreamUtils.fillBuffer() on that (although take care to perhaps wrap 
the InputStream in a BufferedInputStream, and you'll have to close it yourself, 
see the javadoc for more details).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to