mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-09-01 01:35:14 +00:00
Have TimeoutError hexlify blobs
This commit is contained in:
parent
483c88b958
commit
a2eab1577d
2 changed files with 9 additions and 1 deletions
|
@ -241,7 +241,7 @@ class Node(object):
|
||||||
|
|
||||||
def log_error(err, n):
|
def log_error(err, n):
|
||||||
log.error("error storing blob_hash %s at %s", binascii.hexlify(blob_hash), str(n))
|
log.error("error storing blob_hash %s at %s", binascii.hexlify(blob_hash), str(n))
|
||||||
log.error(binascii.hexlify(err.getErrorMessage()))
|
log.error(err.getErrorMessage())
|
||||||
log.error(err.getTraceback())
|
log.error(err.getTraceback())
|
||||||
|
|
||||||
def log_success(res):
|
def log_success(res):
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
# The docstrings in this module contain epytext markup; API documentation
|
# The docstrings in this module contain epytext markup; API documentation
|
||||||
# may be created by processing this file with epydoc: http://epydoc.sf.net
|
# may be created by processing this file with epydoc: http://epydoc.sf.net
|
||||||
|
|
||||||
|
import binascii
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from twisted.internet import protocol, defer
|
from twisted.internet import protocol, defer
|
||||||
|
@ -23,6 +24,13 @@ reactor = twisted.internet.reactor
|
||||||
|
|
||||||
class TimeoutError(Exception):
|
class TimeoutError(Exception):
|
||||||
""" Raised when a RPC times out """
|
""" Raised when a RPC times out """
|
||||||
|
def __init__(self, remote_contact_id):
|
||||||
|
# remote_contact_id is a binary blob so we need to convert it
|
||||||
|
# into something more readable
|
||||||
|
msg = 'Timeout connecting to {}'.format(binascii.hexlify(remote_contact_id))
|
||||||
|
Exception.__init__(self, msg)
|
||||||
|
self.remote_contact_id = remote_contact_id
|
||||||
|
|
||||||
|
|
||||||
class KademliaProtocol(protocol.DatagramProtocol):
|
class KademliaProtocol(protocol.DatagramProtocol):
|
||||||
""" Implements all low-level network-related functions of a Kademlia node """
|
""" Implements all low-level network-related functions of a Kademlia node """
|
||||||
|
|
Loading…
Add table
Reference in a new issue