code: def exception_message():
      
      exc_type, exc_value, exc_tb = exc_info = sys.exc_info()
      return {'exception': {'type': exc_type,
                            'value': exc_value,
                            'traceback': exc_tb},
              'traceback': traceback.format_exception(*exc_info)}
docs: Create a message with details on the exception.