Skip to content

Commit f879e81

Browse files
committed
resctl-bench: upload: Improve debugging when submission failed
Currently we don't print a lot when the submission fails. Change the error message to be something a little more sensible as well as print the whole HTTP response text on an error for additional debugging context. Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
1 parent fd9a731 commit f879e81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

resctl-bench/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,15 @@ impl Program {
280280
let response = minreq::post(args.upload_url.as_ref().unwrap())
281281
.with_json(&request)?
282282
.send()?;
283+
let response_body = response.as_str()?;
283284

284-
let response: LambdaResponse = serde_json::from_str(response.as_str()?)?;
285+
let response: LambdaResponse = serde_json::from_str(response_body)?;
285286
if response.issue.is_none() {
286287
if let Some(error_message) = response.error_message {
287288
error!("Failed to submit benchmark: {}", error_message);
288289
} else {
289-
error!("Submission failed for an unknown reason...");
290+
error!("Failed to submit benchmark: Unknown reason.");
291+
error!("Lambda response: {}", response_body);
290292
}
291293
std::process::exit(1);
292294
}

0 commit comments

Comments
 (0)