Print the underlying error when a key upload fails

This commit is contained in:
Heiko Schaefer 2021-07-29 18:21:01 +02:00
parent 396ce9d8c6
commit 420550ce75

View file

@ -425,11 +425,12 @@ fn main() -> Result<()> {
print!("Upload key '{}'", key);
let upload_res = run_test(&mut card, test_upload_keys, &[key]);
if let Err(TestError::KeyUploadError(s, _)) = upload_res {
if let Err(TestError::KeyUploadError(_file, err)) = &upload_res {
// The card doesn't support this key type, so skip to the
// next key - don't try to decrypt/sign for this key.
println!(" => Upload failed, skip tests");
println!(" => Upload failed ({:?}), skip tests", err);
continue;
}