File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 3
3
## Unreleased
4
4
5
5
* Ensure all functionality is deactivated when mode is set to ` disabled ` .
6
+ * When an exception is thrown an event is sent to Simvue displaying the traceback.
7
+ * If ` add_process ` is used and an exception is thrown, ` .err ` and ` .out ` files are still uploaded.
6
8
7
9
## [ v1.0.4] ( https://github.com/simvue-io/client/releases/tag/v1.0.4 ) - 2024-09-24
8
10
Original file line number Diff line number Diff line change @@ -414,6 +414,8 @@ def kill_process(
414
414
process .kill ()
415
415
process .wait ()
416
416
417
+ self ._save_output ()
418
+
417
419
def kill_all (self ) -> None :
418
420
"""Kill all running processes"""
419
421
for process in self ._processes .keys ():
Original file line number Diff line number Diff line change 20
20
import pydantic
21
21
import re
22
22
import sys
23
+ import traceback as tb
23
24
import time
24
25
import functools
25
26
import platform
@@ -166,11 +167,19 @@ def _handle_exception_throw(
166
167
if not _is_running :
167
168
return
168
169
169
- self .set_status ("terminated" if _is_terminated else "failed" )
170
-
171
170
if not self ._active :
172
171
return
173
172
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 )
181
+ self .set_status ("terminated" if _is_terminated else "failed" )
182
+
174
183
# If the dispatcher has already been aborted then this will
175
184
# fail so just continue without the event
176
185
with contextlib .suppress (RuntimeError ):
@@ -1415,7 +1424,8 @@ def _tidy_run(self) -> None:
1415
1424
if self ._status == "running" :
1416
1425
if self ._dispatcher :
1417
1426
self ._dispatcher .join ()
1418
- self .set_status ("completed" )
1427
+ if self ._active :
1428
+ self .set_status ("completed" )
1419
1429
elif self ._dispatcher :
1420
1430
self ._dispatcher .purge ()
1421
1431
self ._dispatcher .join ()
You can’t perform that action at this time.
0 commit comments