Download:
child 54:53e3c39fff13
parent 52:e1ca1959db76
53:ed7f35f52927
Anton Shestakov <av6@dwimlabs.net>, Thu, 23 Jun 2016 14:58:09 +0800
checker: try and catch exceptions from execute() and somewhat finish the job Exceptions coming from execute() are programming errors in checker.py, but jobs still need to tell that they are finished (and failed) to be processed by incoming.py.

1 файлов изменено, 9 вставок(+), 1 удалений(-) [+]
checker.py file | annotate | diff | comparison | revisions
--- a/checker.py Thu Jun 23 14:38:55 2016 +0800
+++ b/checker.py Thu Jun 23 14:58:09 2016 +0800
@@ -112,12 +112,20 @@
print('# C&O job finished: {}'.format(now()))
+def bad_exit():
+ print('# C&O job failed (exception not caught)')
+ print('# C&O job finished: {}'.format(now()))
+
+
def main():
parser = ArgumentParser()
parser.add_argument('config', help='configuration file (YAML)', type=FileType('r'))
args = parser.parse_args()
config = yaml.safe_load(args.config)
- execute(config)
+ try:
+ execute(config)
+ except:
+ bad_exit()
if __name__ == '__main__':