From 95e1c3f38db5c1ed846e06d1f059c33ac4276266 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Wed, 31 Jul 2024 19:06:34 +0000 Subject: [PATCH] Catch all Exceptions and yell about them in logs --- server.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 3e2010f..35945fb 100755 --- a/server.py +++ b/server.py @@ -404,6 +404,10 @@ Please note that this is not network level statistics.\r\n""".encode( pass del G.servers[name[4:]] G.msgs.append(log(f"{name[4:]} has de-linked from the network")) + except Exception: + Err = format_exc() + for line in Err.split("\r\n"): + log(line, "ERROR") async def connectServer(hostname: str, port: int): @@ -583,7 +587,11 @@ async def connectServer(hostname: str, port: int): log("OSError: " + str(E), "ERROR") if G.cwlgd: raise FailedLinkError - + except Exception: + Err = format_exc() + for line in Err.split("\r\n"): + log(line, "ERROR") + raise FailedLinkError async def runServer(address: str, port: int): global G