Skip to content

Commit 7da4c23

Browse files
committed
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 <[email protected]>
1 parent 5ba3b2f commit 7da4c23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

resctl-bench/src/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ impl Program {
281281
.with_json(&request)?
282282
.send()?;
283283

284+
if response.status_code != 200 {
285+
error!("Failed to submit benchmark: HTTP status code unexpected.");
286+
error!("Lambda response: {:#?}", response);
287+
std::process::exit(1);
288+
}
289+
284290
let response: LambdaResponse = serde_json::from_str(response.as_str()?)?;
285291
if response.issue.is_none() {
286292
if let Some(error_message) = response.error_message {

0 commit comments

Comments
 (0)