code: def message_for_exception(exception: Exception, message: str) -> Sequence[Token]:
      
      tb = sys.exc_info()[2]
      buffer = io.StringIO()
      traceback.print_tb(tb, file=io)  # type: ignore
      # fmt: off
      return (
          red, message + "\n",
          exception.__class__.__name__,
          str(exception), "\n",
          reset, buffer.getvalue()
      )
docs: Returns a tuple suitable for cli_ui.error()
      from the given exception.
      (Traceback will be part of the message, after
      the ``message`` argument)
  
      Useful when the exception occurs in an other thread
      than the main one.