diff options
author | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-04 17:03:10 +0300 |
---|---|---|
committer | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-04 17:03:10 +0300 |
commit | 6189206577786426b97fcbb7f84f1a06caf0c9cf (patch) | |
tree | bb54b92e2aa39cdac033aea9f1add7ec895e7ddc | |
parent | 0cade754f125bd65bd657fa2b78240a5b7b7f61c (diff) | |
download | wmf-ci-arch-6189206577786426b97fcbb7f84f1a06caf0c9cf.tar.gz |
Add: catching of, logging exceptions
-rwxr-xr-x | api.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -306,7 +306,13 @@ def main(): app = bottle.Bottle() pubkey = get_key_from_file(pubkey_filename) api.setup(app, pubkey) - app.run(host=HOST, port=PORT) + try: + app.run(host=HOST, port=PORT) + except SystemExit as e: + logging.info('Terminating normally') + except Exception as e: + logging.error('Caught exception %s', str(e)) + sys.exit(1) main() |