From 5f8a2f66909d29265a3abbb1e960fff56dd26e72 Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 4 Aug 2026 10:08:18 +0530 Subject: [PATCH] fix: propagate send error correctly (#13598) Currently if the destination notification fails at connect stage itself, it logs the error just as error sending request, with no other information. This PR instead captures the error, and logs the debug fmt which looks like ``` reqwest::Error { kind: Request, url: "https://localhost:5001/", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) } ``` Which provides more info to debug the issue. Signed-off-by: Yashodhan Joshi Co-authored-by: Yashodhan Joshi --- src/core/src/alerts/alert.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/src/alerts/alert.rs b/src/core/src/alerts/alert.rs index 3620d26b81..e5c2f475a3 100644 --- a/src/core/src/alerts/alert.rs +++ b/src/core/src/alerts/alert.rs @@ -1702,7 +1702,13 @@ async fn send_http_notification(endpoint: &Endpoint, msg: String) -> Result v, + Err(e) => { + log::error!("error sending request to {} with error {e:?}", endpoint.url); + return Err(anyhow::anyhow!("error sending request : {e:?}")); + } + }; let resp_status = resp.status(); let resp_body = resp.text().await?;