From 78a0fb46b072f2cb037efb5913d07fef1871935b Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Thu, 24 Oct 2019 11:46:13 +0800 Subject: [PATCH] Catching and logging when start_api raises an exception --- pisa/pisad.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pisa/pisad.py b/pisa/pisad.py index 5ae3348..578279b 100644 --- a/pisa/pisad.py +++ b/pisa/pisad.py @@ -36,5 +36,9 @@ if __name__ == '__main__': logger.error("bitcoind is running on a different network, check conf.py and bitcoin.conf. Shutting down") else: - # Fire the api - start_api() + try: + # Fire the api + start_api() + except Exception as e: + logger.error("An error occurred: {}. Shutting down".format(e)) + exit(1)