Skip to content

Commit 074fda5

Browse files
Downgrade socket problems to warnings
Previously, these were logged at exception - which logs at ERROR and prints a traceback. This led to two problems: first, that they're not kdcproxy errors (rather problems with the other end); and second, that the traceback is quite noisy. Log a simplified version of the exception instead of the traceback. In the process, correct the sendall() error message to refer to sendall(), not recv().
1 parent bb1b341 commit 074fda5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

kdcproxy/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ def __await_reply(self, pr, rsocks, wsocks, timeout):
9999
else:
100100
sock.sendall(pr.request)
101101
extra = 10 # New connections get 10 extra seconds
102-
except Exception:
103-
logging.exception('Error in recv() of %s', sock)
102+
except Exception as e:
103+
logging.warning("Conection broken while writing (%s)", e)
104104
continue
105105
rsocks.append(sock)
106106
wsocks.remove(sock)
107107

108108
for sock in r:
109109
try:
110110
reply = self.__handle_recv(sock, read_buffers)
111-
except Exception:
112-
logging.exception('Error in recv() of %s', sock)
111+
except Exception as e:
112+
logging.warning("Connection broken while reading (%s)", e)
113113
if self.sock_type(sock) == socket.SOCK_STREAM:
114114
# Remove broken TCP socket from readers
115115
rsocks.remove(sock)

0 commit comments

Comments
 (0)