This is an automated email from the ASF dual-hosted git repository.
mthomsen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new 0f775f3 NIFI-7195 - Catch MongoException to route flow files to
failure
0f775f3 is described below
commit 0f775f3a578ad855d4768619d361ff30a0f380ab
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;