Catch all Exceptions and yell about them in logs
This commit is contained in:
parent
85f4b289e8
commit
95e1c3f38d
1 changed files with 9 additions and 1 deletions
10
server.py
10
server.py
|
@ -404,6 +404,10 @@ Please note that this is not network level statistics.\r\n""".encode(
|
||||||
pass
|
pass
|
||||||
del G.servers[name[4:]]
|
del G.servers[name[4:]]
|
||||||
G.msgs.append(log(f"{name[4:]} has de-linked from the network"))
|
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):
|
async def connectServer(hostname: str, port: int):
|
||||||
|
@ -583,7 +587,11 @@ async def connectServer(hostname: str, port: int):
|
||||||
log("OSError: " + str(E), "ERROR")
|
log("OSError: " + str(E), "ERROR")
|
||||||
if G.cwlgd:
|
if G.cwlgd:
|
||||||
raise FailedLinkError
|
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):
|
async def runServer(address: str, port: int):
|
||||||
global G
|
global G
|
||||||
|
|
Loading…
Reference in a new issue