Catching and logging when start_api raises an exception

This commit is contained in:
Salvatore Ingala
2019-10-24 11:46:13 +08:00
parent b633c89724
commit 78a0fb46b0

View File

@@ -36,5 +36,9 @@ if __name__ == '__main__':
logger.error("bitcoind is running on a different network, check conf.py and bitcoin.conf. Shutting down") logger.error("bitcoind is running on a different network, check conf.py and bitcoin.conf. Shutting down")
else: else:
# Fire the api try:
start_api() # Fire the api
start_api()
except Exception as e:
logger.error("An error occurred: {}. Shutting down".format(e))
exit(1)