def exception_str(value):
    '''
    Formats Exception object to a string. Unlike default str():

    - can handle unicode strings in exception arguments
    - tries to format arguments as str(), not as repr()
    '''
    try:
        return ', '.join([smart_str(b) for b in value])
    except (TypeError, __HOLE__): # happens for non-iterable values
        try:
            return smart_str(value)
        except UnicodeEncodeError:
            try:
                return repr(value)
            except Exception:
                return '<Unprintable value>'
dataset/ETHPy150Open isagalaev/django_errorlog/django_errorlog/models.py/exception_str