From 7da4c23313ce40a0b19402cf3d4aa654c5d66841 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Thu, 25 Jul 2024 15:27:02 +0100 Subject: [PATCH] resctl-bench: upload: Check HTTP status code 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 --- resctl-bench/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resctl-bench/src/main.rs b/resctl-bench/src/main.rs index 3a573d2..822ae31 100644 --- a/resctl-bench/src/main.rs +++ b/resctl-bench/src/main.rs @@ -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 {