Skip to content

Commit 107cda0

Browse files
authored
NO_TICKET: Catch MongoCommandException (#234)
1 parent 5634939 commit 107cda0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

document-store/src/main/java/org/hypertrace/core/documentstore/mongo/MongoCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public Optional<Document> update(
560560
throws IOException {
561561
try {
562562
return updateExecutor.update(query, updates, updateOptions);
563-
} catch (final MongoWriteException e) {
563+
} catch (final MongoCommandException | MongoWriteException e) {
564564
if (e.getCode() == MONGODB_DUPLICATE_KEY_ERROR_CODE) {
565565
throw new DuplicateDocumentException();
566566
}

0 commit comments

Comments
 (0)