Skip to content

Commit

Permalink
ref: Improve error for connection timeout (#818)
Browse files Browse the repository at this point in the history
Otherwise you just get `timed out` as error and have no clue what's
going on.
  • Loading branch information
flub authored Mar 9, 2023
1 parent 9323e10 commit 9f2b486
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::protocol::{
};
use crate::tls::{self, Keypair, PeerId};
use abao::decode::AsyncSliceDecoder;
use anyhow::{anyhow, bail, Result};
use anyhow::{anyhow, bail, Context, Result};
use bytes::BytesMut;
use futures::Future;
use postcard::experimental::max_size::MaxSize;
Expand Down Expand Up @@ -76,7 +76,7 @@ async fn setup(opts: Options) -> Result<quinn::Connection> {

debug!("connecting to {}", opts.addr);
let connect = endpoint.connect(opts.addr, "localhost")?;
let connection = connect.await?;
let connection = connect.await.context("failed connecting to provider")?;

Ok(connection)
}
Expand Down

0 comments on commit 9f2b486

Please sign in to comment.