Skip to content

Commit

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

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Jul 25, 2024
1 parent f879e81 commit 514ce13
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resctl-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ impl Program {
.send()?;
let response_body = response.as_str()?;

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

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

0 comments on commit 514ce13

Please sign in to comment.