Skip to content

Commit

Permalink
resctl-bench: upload: Check HTTP status code
Browse files Browse the repository at this point in the history
We should check if the HTTP status code from the Lambda function is 200
OK. If not, print the whole response for debugging.

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Jul 25, 2024
1 parent ab0edf3 commit 5e36e56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resctl-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ impl Program {
.with_json(&request)?
.send()?;

if response.status_code != 200 {
error!("Failed to submit benchmark: HTTP status code unexpected.");
error!("Lambda response: {:#?}", response);
std::process::exit(1);
}

let response: LambdaResponse = serde_json::from_str(response.as_str()?)?;
if response.issue.is_none() {
if let Some(error_message) = response.error_message {
Expand Down

0 comments on commit 5e36e56

Please sign in to comment.