From e278c2eff48d3d197ffe613e911569c57f105d70 Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Tue, 16 Apr 2024 11:21:16 +0200 Subject: [PATCH] exporter: transmitting exporter's response body --- src/exporter.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/exporter.rs b/src/exporter.rs index cfa3353..e64466f 100644 --- a/src/exporter.rs +++ b/src/exporter.rs @@ -61,7 +61,25 @@ pub async fn post_exporter_query(body: &String, execute: bool) -> Result { - format!("Query successfully {}", exporter_params.done) + let text = resp.text().await; + match text { + Ok(ok_text) => { + format!("{}", ok_text) + + } + Err(e) => { + warn!( + "The code was 200 OK, but can't get the body of the Exporter's response, while {} query; reply was `{}`, error: {}", + exporter_params.doing, body, e + ); + return Err(FocusError::ExporterQueryErrorReqwest(format!( + "Error while {} query, the code was 200 OK, but can't get the body of the Exporter's response: {:?}", + exporter_params.doing, body + ))); + + } + } + } code => { warn!(