Dean Magee
05/19/2021, 11:57 PMdef alert_failed(obj, old_state, new_state):
if new_state.is_failed():
myTeamsMessage = pymsteams.connectorcard(os.getenv("MSTEAMS_WEBHOOK_URL"))
myTeamsMessage.title("An error has occurred!")
Im trying to grab the text that Python spits out as an error message and include that in my MS Teams message. Any idea how to do that?Chris White
05/20/2021, 12:06 AMnew_state.result
which should be an Exception
type; you can then convert to a string using either str(new_state.result)
or repr(new_state.result)