summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lwirzenius@wikimedia.org>2019-07-04 17:03:10 +0300
committerLars Wirzenius <lwirzenius@wikimedia.org>2019-07-04 17:03:10 +0300
commit6189206577786426b97fcbb7f84f1a06caf0c9cf (patch)
treebb54b92e2aa39cdac033aea9f1add7ec895e7ddc
parent0cade754f125bd65bd657fa2b78240a5b7b7f61c (diff)
downloadwmf-ci-arch-6189206577786426b97fcbb7f84f1a06caf0c9cf.tar.gz
Add: catching of, logging exceptions
-rwxr-xr-xapi.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/api.py b/api.py
index a20b8fc..bbdc7d7 100755
--- a/api.py
+++ b/api.py
@@ -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()