'Format an error message if server selection fails.
Hold the lock when calling this.'

def _error_message(self, selector):

    is_replica_set = (self._description.topology_type in (TOPOLOGY_TYPE.ReplicaSetWithPrimary, TOPOLOGY_TYPE.ReplicaSetNoPrimary))
    if is_replica_set:
        server_plural = 'replica    set    members'
    elif (self._description.topology_type == TOPOLOGY_TYPE.Sharded):
        server_plural = 'mongoses'
    else:
        server_plural = 'servers'
    if self._description.known_servers:
        if (selector is writable_server_selector):
            if is_replica_set:
                return 'No    primary    available    for    writes'
            else:
                return ('No    %s    available    for    writes' % server_plural)
        else:
            return ('No    %s    match    selector    "%s"' % (server_plural, selector))
    else:
        addresses = list(self._description.server_descriptions())
        servers = list(self._description.server_descriptions().values())
        if (not servers):
            if is_replica_set:
                return ('No    %s    available    for    replica    set    name    "%s"' % (server_plural, self._settings.replica_set_name))
            else:
                return ('No    %s    available' % server_plural)
        error = servers[0].error
        same = all(((server.error == error) for server in servers[1:]))
        if same:
            if (error is None):
                return ('No    %s    found    yet' % server_plural)
            if (is_replica_set and (not set(addresses).intersection(self._seed_addresses))):
                return ('Could    not    reach    any    servers    in    %s.    Replica    set    is    configured    with    internal    hostnames    or    IPs?' % addresses)
            return str(error)
        else:
            return ','.join((str(server.error) for server in servers if server.error))
