getMessage(), 'No suitable servers found') !== false) { return new \MongoConnectionException($e->getMessage(), $e->getCode(), $e); } return new $class($e->getMessage(), $e->getCode(), $e); } /** * @throws \MongoException */ public static function toLegacy(Exception\Exception $e, $fallbackClass = 'MongoException') { throw self::convertException($e, $fallbackClass); } }