Skip to content

Commit

Permalink
scheduler: fix exceptions and exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Jun 4, 2020
1 parent 671930d commit aaba326
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ async def start(self):

except SchedulerError as exc:
await self.shutdown(exc)
raise exc from None

except Exception as exc:
try:
Expand Down
5 changes: 3 additions & 2 deletions cylc/flow/scheduler_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def get_option_parser(is_restart):
return parser


# options we cannot simply extract from the parser
# options we cannot simply extract from the parser
DEFAULT_OPTS = {
'debug': False,
'verbose': False,
Expand Down Expand Up @@ -381,9 +381,10 @@ def scheduler_cli(parser, options, args, is_restart=False):
# In case of exceptions in the shutdown method itself.
LOG.exception(exc2)
raise exc2 from None
sys.exit(1)
except Exception:
# suppress the exception to prevent it appearing in the log
pass
sys.exit(1)
finally:
LOG.info("DONE")
_close_logs()
Expand Down

0 comments on commit aaba326

Please sign in to comment.