Skip to content

Commit

Permalink
Properly return an error from SprocketsClient::connect (#6641)
Browse files Browse the repository at this point in the history
This inadvertnetly got turned into an `.unwrap()` which wasn't caught in
other testing. On the `a4x2` setup, the first connect fails which is
expected. Just give the error back.
  • Loading branch information
labbott authored Sep 23, 2024
1 parent 3d73a85 commit 2d203de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sled-agent/src/bootstrap/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use tokio::io::AsyncWriteExt;
#[derive(Debug, Error)]
pub enum Error {
#[error("Could not connect to {addr}: {err}")]
Connect { addr: SocketAddrV6, err: io::Error },
Connect { addr: SocketAddrV6, err: sprockets_tls::Error },

#[error("Failed serializing request: {0}")]
Serialize(serde_json::Error),
Expand Down Expand Up @@ -115,7 +115,7 @@ impl Client {
log.clone(),
)
.await
.unwrap();
.map_err(|err| Error::Connect { addr: self.addr, err })?;

let mut stream = Box::new(tokio::io::BufStream::new(stream));

Expand Down

0 comments on commit 2d203de

Please sign in to comment.