From e278c2eff48d3d197ffe613e911569c57f105d70 Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Tue, 16 Apr 2024 11:21:16 +0200 Subject: [PATCH 1/2] 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!( From 9ab6d1b373f8f3aeb3d468241b8eccc29c68e8e5 Mon Sep 17 00:00:00 2001 From: Enola Knezevic <115070135+enola-dkfz@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:34:35 +0200 Subject: [PATCH 2/2] Update src/exporter.rs Co-authored-by: Jan <59206115+Threated@users.noreply.github.com> --- src/exporter.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/exporter.rs b/src/exporter.rs index e64466f..5bb22aa 100644 --- a/src/exporter.rs +++ b/src/exporter.rs @@ -63,10 +63,7 @@ pub async fn post_exporter_query(body: &String, execute: bool) -> Result { let text = resp.text().await; match text { - Ok(ok_text) => { - format!("{}", ok_text) - - } + Ok(ok_text) => 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: {}",