Better logging for RPI error

This commit is contained in:
Mariano Sorgente
2021-02-04 01:27:59 -08:00
committed by Gene Hoffman
parent 055ac0b1da
commit ebe86ba3e4
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -236,8 +236,12 @@ class FullNode:
responses = []
while curr_sub_height > peak_sub_height - 5:
curr = await peer.request_sub_block(full_node_protocol.RequestSubBlock(uint32(curr_sub_height), True))
if curr is None:
raise ValueError(f"Failed to fetch sub block {curr_sub_height} from {peer.get_peer_info()}, timed out")
if curr is None or not isinstance(curr, full_node_protocol.RespondSubBlock):
raise ValueError(f"Failed to fetch sub block {curr_sub_height} from {peer.get_peer_info()}")
raise ValueError(
f"Failed to fetch sub block {curr_sub_height} from {peer.get_peer_info()}, wrong type {type(curr)}"
)
responses.append(curr)
if self.blockchain.contains_sub_block(curr.sub_block.prev_header_hash) or curr_sub_height == 0:
found_fork_point = True
+1 -1
View File
@@ -359,7 +359,7 @@ class ChiaServer:
except Exception as e:
if self.connection_close_task is None:
tb = traceback.format_exc()
connection.log.error(f"Exception: {e}, closing connection {connection}. {tb}")
connection.log.error(f"Exception: {e}, closing connection {connection.get_peer_info()}. {tb}")
else:
connection.log.debug(f"Exception: {e} while closing connection")
pass