Skip to content

Commit

Permalink
catch catch errors in script runner init
Browse files Browse the repository at this point in the history
  • Loading branch information
enra64 committed Jul 20, 2021
1 parent 5b6f84c commit 42a74bf
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions host/ScriptHandler.py
Expand Up @@ -49,17 +49,20 @@ def start_script(self, script_name: str, source_id):
self.is_script_running = False

self.logger.debug("Attempting to start {} due to {}".format(script_name, source_id))
self.current_script_runner = \
ScriptRunner(
script_name,
self.canvas,
self.draw_cycle_finished_callback,
self.send_object,
self.send_object_to_all,
self.start_script,
self.get_client_list,
self.script_runner_crashed
)
try:
self.current_script_runner = \
ScriptRunner(
script_name,
self.canvas,
self.draw_cycle_finished_callback,
self.send_object,
self.send_object_to_all,
self.start_script,
self.get_client_list,
self.script_runner_crashed
)
except Exception as e:
self.logger.error("Failed to start {}".format(script_name), e)

# don't start the new script if CustomAtExit was triggered
if self.current_script_runner.ok and not CustomAtExit().is_shutdown_initiated():
Expand Down

0 comments on commit 42a74bf

Please sign in to comment.