Catch MongoException to route flow files to failure
This closes
*/
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;
