Skip to content

Commit

Permalink
Handle other exceptions from program.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhsamuel committed Apr 28, 2021
1 parent 3e066da commit 4830191
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/apsis/apsis.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,23 @@ def done(future):
outputs =exc.outputs,
)

except Exception as exc:
# Program raised some other exception.
log.error(
f"exception waiting for run: {run.run_id}", exc_info=True)
self.run_history.record(
run, f"internal error in program: {exc}")
tb = traceback.format_exc().encode()
self._transition(
run, run.STATE.error,
outputs ={
"output": Output(
OutputMetadata("traceback", length=len(tb)),
tb
),
}
)

else:
# Program ran and completed successfully.
self.run_history.record(run, "program success")
Expand Down

0 comments on commit 4830191

Please sign in to comment.