Explorar o código

fud: better handle reply error in `fetch_nodes()`

epiphany hai 1 ano
pai
achega
9a148af7cb
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      bin/fud/fud/src/lib.rs

+ 2 - 2
bin/fud/fud/src/lib.rs

@@ -215,12 +215,12 @@ impl DhtHandler for Fud {
         let request = FudFindNodesRequest { key: *key };
         channel.send(&request).await?;
 
-        let reply = msg_subscriber_nodes.receive_with_timeout(self.dht().settings.timeout).await?;
+        let reply = msg_subscriber_nodes.receive_with_timeout(self.dht().settings.timeout).await;
 
         msg_subscriber_nodes.unsubscribe().await;
         self.cleanup_channel(channel).await;
 
-        Ok(reply.nodes.clone())
+        Ok(reply?.nodes.clone())
     }
 }