def convert_args_to_str(args, max_len=None):
    """ Convert args to a string, allowing for some arguments to raise
    exceptions during conversion and ignoring them.
    """
    length = 0
    strs = ['' for i in range(len(args))]
    for i, arg in enumerate(args):
        try:
            sarg = repr(arg)
        except Exception:
            sarg = '< could not convert arg to str >'
        strs[i] = sarg
        length += len(sarg) + 2
        if max_len is not None and length > max_len:
            return '({}'.format(', '.join(strs[:i + 1]))[:max_len]
    else:
        return '({})'.format(', '.join(strs))
