datagram decode error logging

This commit is contained in:
Jack Robison 2018-04-19 15:46:56 -04:00
parent b89823c968
commit 11aad04c31
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -108,7 +108,8 @@ class KademliaProtocol(protocol.DatagramProtocol):
message = self._translator.fromPrimitive(msgPrimitive)
except (encoding.DecodeError, ValueError) as err:
# We received some rubbish here
log.exception("Error decoding datagram from %s:%i - %s", address[0], address[1], err)
log.warning("Error decoding datagram %s from %s:%i - %s", datagram.encode('hex'),
address[0], address[1], err)
return
except (IndexError, KeyError):
log.warning("Couldn't decode dht datagram from %s", address)