Skip to content

Commit

Permalink
Merge pull request #235 from spacetelescope/bugfix/CATKIT-95-child-pr…
Browse files Browse the repository at this point in the history
…oc-exitcode

CATKIT-95 Raise exception upon non-zero exitcode of child process
  • Loading branch information
jamienoss authored May 14, 2021
2 parents 319bad2 + 5f52800 commit c2c2c56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions catkit/testbed/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def start(self):
# must return SafetyException type specifically to signal queue to stop in typical calling scripts
raise safety_exception

experiment_process.join()
if experiment_process.exitcode:
raise Exception(f"Child process ('{self.name}' with pid: '{experiment_process.pid}') exited with non-zero exitcode: '{experiment_process.exitcode}'")

def run_experiment(self):
"""
Wrapper for experiment to catch the softkill function's KeyboardInterrupt signal more gracefully.
Expand Down

0 comments on commit c2c2c56

Please sign in to comment.