Use anyhow for key.rs error handling

This commit is contained in:
link2xt
2021-06-19 03:19:04 +03:00
parent a47c0486ae
commit 8ea773628d
6 changed files with 19 additions and 94 deletions

View File

@@ -86,11 +86,7 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Lot {
};
let fingerprint: Fingerprint = match fingerprint.parse() {
Ok(fp) => fp,
Err(err) => {
return Error::new(err)
.context("Failed to parse fingerprint in QR code")
.into()
}
Err(err) => return err.context("Failed to parse fingerprint in QR code").into(),
};
let param: BTreeMap<&str, &str> = fragment