This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch support/nifi-1.11.x in repository https://gitbox.apache.org/repos/asf/nifi.git
commit f1d1c0f2e239776226b8261229e73ba41ce92a3c Author: Pierre Villard <[email protected]> AuthorDate: Tue Feb 25 14:00:31 2020 -0800 NIFI-7195 - Catch MongoException to route flow files to failure This closes #4089 Signed-off-by: Mike Thomsen <[email protected]> --- .../main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java index 5fbc819..3915733 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java @@ -16,6 +16,7 @@ */ package org.apache.nifi.processors.mongodb; +import com.mongodb.MongoException; import com.mongodb.WriteConcern; import com.mongodb.client.MongoCollection; import org.apache.nifi.annotation.behavior.EventDriven; @@ -144,7 +145,7 @@ public class PutMongoRecord extends AbstractMongoProcessor { if (inserts.size() > 0) { collection.insertMany(inserts); } - } catch (SchemaNotFoundException | IOException | MalformedRecordException e) { + } catch (SchemaNotFoundException | IOException | MalformedRecordException | MongoException e) { getLogger().error("PutMongoRecord failed with error:", e); session.transfer(flowFile, REL_FAILURE); error = true;
