mirror of https://github.com/apache/nifi.git
NIFI-7195 - Catch MongoException to route flow files to failure
This closes #4089 Signed-off-by: Mike Thomsen <mthomsen@apache.org>
This commit is contained in:
parent
ac4d52b6ca
commit
0f775f3a57
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue