Skip to content

Commit

Permalink
resctl-bench: upload: Improve debugging when submission failed
Browse files Browse the repository at this point in the history
Currently we don't print a lot when the submission fails. Change the error
message to be something a little more sensible as well as print the whole
HTTP response text on an error for additional debugging context.

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Jul 25, 2024
1 parent fd9a731 commit f879e81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resctl-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,15 @@ impl Program {
let response = minreq::post(args.upload_url.as_ref().unwrap())
.with_json(&request)?
.send()?;
let response_body = response.as_str()?;

let response: LambdaResponse = serde_json::from_str(response.as_str()?)?;
let response: LambdaResponse = serde_json::from_str(response_body)?;
if response.issue.is_none() {
if let Some(error_message) = response.error_message {
error!("Failed to submit benchmark: {}", error_message);
} else {
error!("Submission failed for an unknown reason...");
error!("Failed to submit benchmark: Unknown reason.");
error!("Lambda response: {}", response_body);
}
std::process::exit(1);
}
Expand Down

0 comments on commit f879e81

Please sign in to comment.