def message_for_exception(exception, message):
    tb = sys.exc_info()[2]
    io = StringIO()
    traceback.print_tb(tb, file=io)
    return (red, message + "\n",
            exception.__class__.__name__,
            str(exception), "\n",
            reset,
            io.getvalue())
Returns a tuple suitable for ui.error()
dataset/ETHPy150Open aldebaran/qibuild/python/qisys/ui.py/message_for_exception