Skip to content

Commit

Permalink
fix: include called process err stdout and stderr in logs
Browse files Browse the repository at this point in the history
williams-jack committed Aug 21, 2024
1 parent bf6ee0e commit c542aa0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion worker/orca_grader/__main__.py
Original file line number Diff line number Diff line change
@@ -139,7 +139,12 @@ def run_grading_job(grading_job: GradingJobJSON, no_container: bool,
handle_grading_job(grading_job, container_sha)
except Exception as e:
if isinstance(e, CalledProcessError):
_LOGGER.warning(f"STDERR output of subprocess: {e.stderr.decode()}")
stderr_output, stdout_output = [
encoded_output.decode() if encoded_output is not None else '<None>'
for encoded_output in [e.stderr, e.stdout]
]
_LOGGER.warning(f"STDERR output of subprocess: {stderr_output}")
_LOGGER.warning(f"STDOUT output of subprocess: {stdout_output}")
else:
_LOGGER.warning(
f"Encountered error while trying to run this job: {e}"

0 comments on commit c542aa0

Please sign in to comment.