From 3df3ff6c610760c3adb1dffdd75d8cbaed1b471b Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 29 Nov 2017 10:51:29 -0500 Subject: [PATCH] NIFI-4646: This closes #2306. - Ensuring the reason behind the SchemaNotFoundException is reported when interacting with the configured SchemaRegistry. Signed-off-by: joewitt --- .../standard/AbstractRecordProcessor.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java index 422629d528..6f777ea5eb 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java @@ -17,17 +17,6 @@ package org.apache.nifi.processors.standard; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; @@ -47,6 +36,17 @@ import org.apache.nifi.serialization.WriteResult; import org.apache.nifi.serialization.record.Record; import org.apache.nifi.serialization.record.RecordSchema; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + public abstract class AbstractRecordProcessor extends AbstractProcessor { static final PropertyDescriptor RECORD_READER = new PropertyDescriptor.Builder() @@ -128,7 +128,9 @@ public abstract class AbstractRecordProcessor extends AbstractProcessor { attributes.putAll(writeResult.getAttributes()); recordCount.set(writeResult.getRecordCount()); } - } catch (final SchemaNotFoundException | MalformedRecordException e) { + } catch (final SchemaNotFoundException e) { + throw new ProcessException(e.getLocalizedMessage(), e); + } catch (final MalformedRecordException e) { throw new ProcessException("Could not parse incoming data", e); } }