diff options
-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() |