HttpsConnector: include destination on connect errors

for more useful log output
old:
Nov 10 11:50:51 foo pvestatd[3378]: proxmox-backup-client failed: Error: error trying to connect: tcp connect error: No route to host (os error 113)
new:
Nov 10 11:55:21 foo pvestatd[3378]: proxmox-backup-client failed: Error: error trying to connect: error connecting to https://thebackuphost:8007/ - tcp connect error: No route to host (os error 113)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-11-10 11:55:53 +01:00
parent f3fde36beb
commit 5d08c750ef

View File

@ -129,7 +129,12 @@ impl hyper::service::Service<Uri> for HttpsConnector {
.to_string();
let config = this.ssl_connector.configure();
let conn = this.http.call(dst).await?;
let dst_str = dst.to_string(); // for error messages
let conn = this
.http
.call(dst)
.await
.map_err(|err| format_err!("error connecting to {} - {}", dst_str, err))?;
let _ = set_tcp_keepalive(conn.as_raw_fd(), PROXMOX_BACKUP_TCP_KEEPALIVE_TIME);