vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
242 stars 52 forks source link

change `SecioError` and `NoiseError` to descendants of `LPStreamError` #1047

Closed etan-status closed 4 months ago

etan-status commented 4 months ago

When higher modules read from streams, they often use Noise / Secio interchangeably with other streams. It simplifies exception handling a lot if they reflect their nature as specialized stream wrappers by also inheriting from LPStreamError instead of the root LPError.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.77%. Comparing base (6c87348) to head (208c176).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1047/graphs/tree.svg?width=650&height=150&src=pr&token=UR5JRQ249W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1047?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) ```diff @@ Coverage Diff @@ ## unstable #1047 +/- ## ========================================= Coverage 82.77% 82.77% ========================================= Files 91 91 Lines 15604 15604 ========================================= Hits 12916 12916 Misses 2688 2688 ``` | [Files](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1047?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [libp2p/protocols/secure/noise.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1047?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvbm9pc2Uubmlt) | `89.65% <ø> (ø)` | | | [libp2p/protocols/secure/secio.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1047?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvc2VjaW8ubmlt) | `3.96% <ø> (ø)` | |