Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
giangndm committed Dec 18, 2024
1 parent ab092c3 commit a36e073
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ impl SharedCtx {
}
RouteAction::Next(next) => {
let source = self.router.local_id();
self.conn(&next).ok_or(anyhow!("peer not found"))?.try_send(PeerMessage::Unicast(source, dest, service_id, data))?;
self.conn(&next)
.ok_or(anyhow!("peer not found {next}"))?
.try_send(PeerMessage::Unicast(source, dest, service_id, data))?;
Ok(())
}
}
Expand All @@ -160,7 +162,10 @@ impl SharedCtx {
}
RouteAction::Next(next) => {
let source = self.router.local_id();
self.conn(&next).ok_or(anyhow!("peer not found"))?.send(PeerMessage::Unicast(source, dest, service_id, data)).await?;
self.conn(&next)
.ok_or(anyhow!("peer not found {next}"))?
.send(PeerMessage::Unicast(source, dest, service_id, data))
.await?;
Ok(())
}
}
Expand Down Expand Up @@ -201,7 +206,7 @@ impl SharedCtx {
}
RouteAction::Next(next) => {
let source = self.router.local_id();
Ok(self.conn(&next).ok_or(anyhow!("peer not found"))?.open_stream(service, source, dest, meta).await?)
Ok(self.conn(&next).ok_or(anyhow!("peer not found {next}"))?.open_stream(service, source, dest, meta).await?)
}
}
}
Expand Down

0 comments on commit a36e073

Please sign in to comment.