Better logging on DHT errors

Timeout errors are common on the dht so log those
at debug, but other errors need to (potentially) recieve
more attention
This commit is contained in:
Job Evers-Meltzer 2016-12-14 17:01:00 -06:00
parent 250831a86a
commit 4f3b5cd802

View file

@ -235,9 +235,14 @@ class Node(object):
known_nodes = {}
def log_error(err, n):
log.debug("error storing blob_hash %s at %s", binascii.hexlify(blob_hash), str(n))
log.debug(err.getErrorMessage())
log.debug(err.getTraceback())
if err.check(protocol.TimeoutError):
log.debug(
"Timeout while storing blob_hash %s at %s",
binascii.hexlify(blob_hash), n)
else:
log.error(
"Unexpected error while storing blob_hash %s at %s: %s",
binascii.hexlify(blob_hash), n, err.getErrorMessage())
def log_success(res):
log.debug("Response to store request: %s", str(res))