Skip to content

Commit ce4943a

Browse files
author
Ali
committed
Gracefully handle search index exceptions on non MongoDB Atlas
1 parent 93b9374 commit ce4943a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Doctrine/ODM/MongoDB/SchemaManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,9 @@ private function isSearchIndexCommandException(CommandException $e): bool
10611061
if ($e->getCode() === self::CODE_COMMAND_NOT_SUPPORTED && str_contains($e->getMessage(), 'Search index')) {
10621062
return true;
10631063
}
1064+
if ($e->getMessage() === '$listSearchIndexes stage is only allowed on MongoDB Atlas') {
1065+
return true;
1066+
}
10641067

10651068
// Older server versions don't support $listSearchIndexes
10661069
// We don't check for an error code here as the code is not documented and we can't rely on it

0 commit comments

Comments
 (0)