Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-bytes): add more context to errors (#2196)
## Description feat(iroh-bytes): add more context to errors add hash and offset/range as context for LeafHashMismatch and ParentHashMismatch errors This is what the log looks like now: ``` 2024-04-16T07:17:19.613913Z WARN iroh_bytes::provider: error: Error { context: "hash 17c8e5a70f69d289105553dfa762064e8cc57ffb9355d76508f557e37ef051db offset 9994240", source: LeafHashMismatch( ChunkNum(0x2620), ), } 2024-04-16T07:17:26.664680Z INFO magicsock{me=34qdsunbluss4zny}:actor:disco{node=kqn3pxyufuskwsup}: iroh_net::magicsock::node_map::best_addr: clearing best_addr reason=PongTimeout has_relay=true old_addr=192.168.1.131:64604 2024-04-16T07:18:05.507191Z INFO poll_recv{me=34qdsunbluss4zny}:disco_in{node=kkpbi4eb5h6jcdjz src=Udp(192.168.1.131:62647)}: iroh_net::magicsock::node_map: inserting new node endpoint in NodeMap node=kkpbi4eb5h6jcdjz relay_url=None 2024-04-16T07:18:05.507311Z INFO poll_recv{me=34qdsunbluss4zny}:disco_in{node=kkpbi4eb5h6jcdjz src=Udp(192.168.1.131:62647)}: iroh_net::magicsock::node_map::endpoint: new direct addr for node addr=192.168.1.131:62647 2024-04-16T07:18:05.510362Z INFO poll_recv{me=34qdsunbluss4zny}:disco_in{node=kkpbi4eb5h6jcdjz src=Udp(192.168.1.131:62647)}: iroh_net::magicsock::node_map::best_addr: selecting new direct path for endpoint addr=192.168.1.131:62647 latency=2.686417ms trust_for=6.499932542s 2024-04-16T07:18:07.994402Z INFO iroh_bytes::provider: sent 100390814 bytes in 2.4763055s 2024-04-16T07:18:07.994461Z WARN iroh_bytes::provider: error: Error { context: "hash 370e2b3002be3b38b120f7b3be53da4cf646810e26f8f4a5018247c8188af5b2 range 65536..98304", source: Error { context: "g4hcwmacxy5trmja66z34u62jt3enaioe34pjjibqjd4qgek6wza", source: ParentHashMismatch( TreeNode::Branch(79, level=4), ), }, } ``` <!-- A summary of what this pull request achieves and a rough list of changes. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates if relevant. - [ ] Tests if relevant.
- Loading branch information