radicle-fetch: More fine-grained errors
The fn io_error disguises all sorts of errors as I/O errors, making
errors in the transport component of radicle-fetch harder to
understand.
Instead, expose a new error type that allows to discriminate.
8 files changed
+64
-75
a670b6e6
→
31039bbc
modified crates/radicle-cli/examples/rad-init-private-clone.md
@@ -10,7 +10,7 @@ $ rad clone rad:z2ug5mwNKZB8KGpBDRTrWHAMbvHCu --seed z6MknSLrJoTcukLrE435hVNQT4J
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-fetch/src/handle.rs
@@ -83,8 +83,6 @@ impl<S> Handle<S> {
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
@@ -93,8 +91,6 @@ pub mod error {
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
modified crates/radicle-fetch/src/lib.rs
@@ -9,7 +9,6 @@ mod refs;
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -28,11 +27,8 @@ use thiserror::Error;
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -128,8 +124,11 @@ fn perform_handshake<S>(handle: &mut Handle<S>) -> Result<handshake::Outcome, Er
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
modified crates/radicle-fetch/src/state.rs
@@ -30,24 +30,22 @@ pub const DEFAULT_FETCH_SPECIAL_REFS_LIMIT: u64 = 1024 * 1024 * 5;
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -62,8 +60,6 @@ pub mod error {
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
modified crates/radicle-fetch/src/transport.rs
@@ -27,16 +27,13 @@ use crate::git::repository;
|
|
|
|
|
|
| - | |
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
@@ -48,7 +45,7 @@ pub trait SignalEof {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -59,6 +56,20 @@ pub struct Transport<S> {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -79,16 +90,16 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -96,11 +107,11 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -108,8 +119,7 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -118,7 +128,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -126,7 +136,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -136,17 +146,11 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -157,13 +161,10 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -174,8 +175,8 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -251,10 +252,6 @@ where
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
@@ -327,9 +324,15 @@ impl WantsHaves {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
modified crates/radicle-fetch/src/transport/fetch.rs
@@ -22,8 +22,8 @@ pub mod error {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -61,11 +61,10 @@ impl PackWriter {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -174,7 +173,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-fetch/src/transport/ls_refs.rs
@@ -60,7 +60,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/worker/channels.rs
@@ -1,4 +1,3 @@
| - | |
|
|
|
|
|
@@ -75,10 +74,9 @@ impl ChannelsFlush {
|
|
|
|
|
|
| - | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -260,8 +258,6 @@ pub struct ChannelFlushWriter<T = Vec<u8>> {
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|