Skip to content

Commit 0959d46

Browse files
committed
refactor(client): return the first connect error, not the last
1 parent 6328823 commit 0959d46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/client/legacy/connect/http.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,10 @@ impl ConnectingTcpRemote {
765765
}
766766
Err(e) => {
767767
trace!("connect error for {}: {:?}", addr, e);
768-
err = Some(e);
768+
// only return the first error, we assume it's the most relevant
769+
if err.is_none() {
770+
err = Some(e);
771+
}
769772
}
770773
}
771774
}

0 commit comments

Comments
 (0)