Improve display of errors with no message in script trace (#108735)

This commit is contained in:
Erik Montnemery 2024-01-28 19:27:14 +01:00 committed by GitHub
parent 5818b6141a
commit 8abb4e5f52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -93,7 +93,7 @@ class TraceElement:
if self._variables:
result["changed_variables"] = self._variables
if self._error is not None:
result["error"] = str(self._error)
result["error"] = str(self._error) or self._error.__class__.__name__
if self._result is not None:
result["result"] = self._result
return result

View file

@ -1341,7 +1341,7 @@ async def test_wait_continue_on_timeout(
}
if continue_on_timeout is False:
expected_trace["0"][0]["result"]["timeout"] = True
expected_trace["0"][0]["error"] = ""
expected_trace["0"][0]["error"] = "TimeoutError"
expected_script_execution = "aborted"
else:
expected_trace["1"] = [{"result": {"event": "test_event", "event_data": {}}}]