Catch exception if daemon fails

main
Bob Mottram 2020-02-19 10:37:40 +00:00
parent 3a57a76703
commit 8ac9a43b29
1 changed files with 5 additions and 1 deletions

View File

@ -5481,7 +5481,11 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \
pubHandler = partial(PubServerUnitTest) pubHandler = partial(PubServerUnitTest)
else: else:
pubHandler = partial(PubServer) pubHandler = partial(PubServer)
try:
httpd = ThreadingHTTPServer(serverAddress, pubHandler) httpd = ThreadingHTTPServer(serverAddress, pubHandler)
except Exception as e:
print('ERROR: HTTP Server failed to start. '+str(e))
return False
httpd.useBlurHash=useBlurHash httpd.useBlurHash=useBlurHash
httpd.mediaInstance=mediaInstance httpd.mediaInstance=mediaInstance