def to_unicode(value):
    try:
        value = text_type(force_text(value))
    except (UnicodeEncodeError, __HOLE__):
        value = '(Error decoding value)'
    except Exception:  # in some cases we get a different exception
        try:
            value = binary_type(repr(type(value)))
        except Exception:
            value = '(Error decoding value)'
    return value
dataset/ETHPy150Open getsentry/raven-python/raven/utils/encoding.py/to_unicode