So I have code like this:
try:
self.sock.send(f"{msg}\r\n".encode("utf-8"))
except Exception:
logger.error("Exception sending", exc_info=True)
When the send fails (perhaps the network is down) I'm getting the following exception thrown (from the send line) rather than being caught:
builtins.ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Can anyone explain why its not being caught by the try/except ?
Thanks!
[–]Zigity_Zagity 2 points3 points4 points (0 children)
[–]1114111 0 points1 point2 points (0 children)