@@ 559-561 (lines=3) @@ | ||
556 | ||
557 | // Different MongoDB versions return different result sets. |
|
558 | // Thus, check code if it exists and fall back on error message |
|
559 | if ($result['ok'] != 1 && ((isset($result['code']) && $result['code'] !== 20) && $result['errmsg'] !== 'already sharded')) { |
|
560 | throw MongoDBException::failedToEnsureDocumentSharding($documentName, $result['errmsg']); |
|
561 | } |
|
562 | } |
|
563 | ||
564 | /** |
|
@@ 579-581 (lines=3) @@ | ||
576 | ||
577 | // Different MongoDB versions return different result sets. |
|
578 | // Thus, check code if it exists and fall back on error message |
|
579 | if ($result['ok'] != 1 && ((isset($result['code']) && $result['code'] !== 23) && $result['errmsg'] !== 'already enabled')) { |
|
580 | throw MongoDBException::failedToEnableSharding($dbName, $result['errmsg']); |
|
581 | } |
|
582 | } |
|
583 | ||
584 | /** |