Skip to content

Commit

Permalink
exporter: transmitting exporter's response body
Browse files Browse the repository at this point in the history
  • Loading branch information
enola-dkfz committed Apr 16, 2024
1 parent 843e8c0 commit e278c2e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,25 @@ pub async fn post_exporter_query(body: &String, execute: bool) -> Result<String,

let text = match resp.status() {
StatusCode::OK => {
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!(
Expand Down

0 comments on commit e278c2e

Please sign in to comment.