Skip to content

Commit 11e44e3

Browse files
committed
JAVA-1388: Changed check for non-existent collection to look for an errmsg that contains "ns not found". This will work with both mongod and mongos, the latter of which returns an errmsg that has "ns not found" embedded in the middle.
1 parent fa7ecf0 commit 11e44e3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

driver-core/src/main/com/mongodb/operation/CommandOperationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public void onResult(final CommandResult result, final MongoException e) {
402402

403403
static void rethrowIfNotNamespaceError(final CommandFailureException e) {
404404
String message = e.getErrorMessage();
405-
if (!message.startsWith("ns not found") && !(message.matches("Collection \\[(.*)\\] not found."))) {
405+
if (!message.contains("ns not found")) {
406406
throw e;
407407
}
408408
}

0 commit comments

Comments
 (0)