Skip to content

Commit 1917fcf

Browse files
committed
Fix Simvue event creation on exception throw
1 parent f16b134 commit 1917fcf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

simvue/run.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import pydantic
2121
import re
2222
import sys
23+
import traceback as tb
2324
import time
2425
import functools
2526
import platform
@@ -169,7 +170,14 @@ def _handle_exception_throw(
169170
if not self._active:
170171
return
171172

172-
self.log_event(traceback or f"An exception was thrown: {_exception_thrown}")
173+
_traceback_out: list[str] = tb.format_exception(exc_type, value, traceback)
174+
_event_msg: str = (
175+
"\n".join(_traceback_out)
176+
if _traceback_out
177+
else f"An exception was thrown: {_exception_thrown}"
178+
)
179+
180+
self.log_event(_event_msg)
173181
self.set_status("terminated" if _is_terminated else "failed")
174182

175183
# If the dispatcher has already been aborted then this will

0 commit comments

Comments
 (0)