Skip to content

Commit 514ce13

Browse files
committed
resctl-bench: upload: Check HTTP status code
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]>
1 parent f879e81 commit 514ce13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

resctl-bench/src/main.rs

+9
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,15 @@ impl Program {
282282
.send()?;
283283
let response_body = response.as_str()?;
284284

285+
if response.status_code != 200 {
286+
error!(
287+
"Failed to submit benchmark: HTTP status code {} unexpected.",
288+
response.status_code
289+
);
290+
error!("Lambda response: {}", response_body);
291+
std::process::exit(1);
292+
}
293+
285294
let response: LambdaResponse = serde_json::from_str(response_body)?;
286295
if response.issue.is_none() {
287296
if let Some(error_message) = response.error_message {

0 commit comments

Comments
 (0)