summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()