Skip to content
Snippets Groups Projects
Commit 75a7e9e3 authored by inso's avatar inso
Browse files

Fix logging + peer document parsing

parent 1ad490df
Branches
Tags 0.32.0RC4
No related merge requests found
...@@ -107,6 +107,11 @@ class NodeConnector(QObject): ...@@ -107,6 +107,11 @@ class NodeConnector(QObject):
conn_handler = next(endpoint.conn_handler(self.session, proxy=proxy)) conn_handler = next(endpoint.conn_handler(self.session, proxy=proxy))
data = await request(conn_handler, **req_args) data = await request(conn_handler, **req_args)
return data return data
except errors.DuniterError as e:
if e.ucode == 1006:
self._logger.debug("{0}".format(str(e)))
else:
raise
except (ClientError, gaierror, TimeoutError, ConnectionRefusedError, ValueError) as e: except (ClientError, gaierror, TimeoutError, ConnectionRefusedError, ValueError) as e:
self._logger.debug("{0}".format(str(e))) self._logger.debug("{0}".format(str(e)))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
...@@ -334,8 +339,7 @@ class NodeConnector(QObject): ...@@ -334,8 +339,7 @@ class NodeConnector(QObject):
break break
self.refresh_peer_data(leaf_data['leaf']['value']) self.refresh_peer_data(leaf_data['leaf']['value'])
except (AttributeError, ValueError, errors.DuniterError) as e: except (AttributeError, ValueError, errors.DuniterError) as e:
self._logger.debug("Incorrect peer data in {leaf}" self._logger.debug("Incorrect peer data in {leaf} : {err}".format(leaf=leaf_hash, err=str(e)))
.format(leaf=leaf_hash))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
else: else:
self.node.merkle_peers_root = peers_data['root'] self.node.merkle_peers_root = peers_data['root']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment