@@ 550-552 (lines=3) @@ | ||
547 | ||
548 | // Different MongoDB versions return different result sets. |
|
549 | // Thus, check code if it exists and fall back on error message |
|
550 | if ($result['ok'] != 1 && ((isset($result['code']) && $result['code'] !== 20) && $result['errmsg'] !== 'already sharded')) { |
|
551 | throw MongoDBException::failedToEnsureDocumentSharding($documentName, $result['errmsg']); |
|
552 | } |
|
553 | } |
|
554 | ||
555 | /** |
|
@@ 570-572 (lines=3) @@ | ||
567 | ||
568 | // Different MongoDB versions return different result sets. |
|
569 | // Thus, check code if it exists and fall back on error message |
|
570 | if ($result['ok'] != 1 && ((isset($result['code']) && $result['code'] !== 23) && $result['errmsg'] !== 'already enabled')) { |
|
571 | throw MongoDBException::failedToEnableSharding($dbName, $result['errmsg']); |
|
572 | } |
|
573 | } |
|
574 | ||
575 | /** |