From 8ac9a43b298f84a2c40b2c4c4bde83ac6d2084a7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 19 Feb 2020 10:37:40 +0000 Subject: [PATCH] Catch exception if daemon fails --- daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 2cd2d58f..94ce5096 100644 --- a/daemon.py +++ b/daemon.py @@ -5481,7 +5481,11 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \ pubHandler = partial(PubServerUnitTest) else: pubHandler = partial(PubServer) - httpd = ThreadingHTTPServer(serverAddress, pubHandler) + try: + httpd = ThreadingHTTPServer(serverAddress, pubHandler) + except Exception as e: + print('ERROR: HTTP Server failed to start. '+str(e)) + return False httpd.useBlurHash=useBlurHash httpd.mediaInstance=mediaInstance