Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prints errors caught in the pysmurf-controller subprocesses #674

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions socs/agents/pysmurf_controller/smurf_subprocess_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,11 @@ def run_smurf_func(cfg: RunCfg) -> RunResult:
return_val=func_map[cfg.func_name](*cfg.args, **cfg.kwargs)
)
except Exception:
exc = traceback.format_exc()
print(f"Exception raised in smurf_func:\n{exc}")
result = RunResult(
success=False,
traceback=traceback.format_exc()
traceback=exc,
)
return result

Expand All @@ -324,9 +326,11 @@ def subprocess_main():
result = RunResult(success=True, return_val=return_val)
return_data = encode_dataclass(result)
except Exception:
exc = traceback.format_exc()
print(f"Exception raised in subprocess:\n{exc}")
result = RunResult(
success=False,
traceback=traceback.format_exc()
traceback=exc,
)
return_data = encode_dataclass(result)
os.write(3, return_data)
Expand Down
Loading