From 5d08c750ef0dfdbe57a711e2e289caf8a2ec3339 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 10 Nov 2020 11:55:53 +0100 Subject: [PATCH] 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 --- src/tools/http.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/http.rs b/src/tools/http.rs index d8603fe5..130aa381 100644 --- a/src/tools/http.rs +++ b/src/tools/http.rs @@ -129,7 +129,12 @@ impl hyper::service::Service 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);