Skip to content

Commit

Permalink
Merge pull request #132 from samply/feature/exporter-body
Browse files Browse the repository at this point in the history
exporter: transmitting exporter's response body
  • Loading branch information
djuarezgf authored Apr 19, 2024
2 parents 843e8c0 + 9ab6d1b commit a124629
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,22 @@ 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) => 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 a124629

Please sign in to comment.