mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
bubble up signing error instead of panicing (#3304)
.expect() may panic, which is probably not what we want here. it seems better to bubble up the error (as we are doing in the other cases) (i was checking some .expect usages after we had a similar issue at #3264)
This commit is contained in:
@@ -190,7 +190,9 @@ pub(crate) fn create_keypair(
|
||||
let key = key_params
|
||||
.generate()
|
||||
.map_err(|err| PgpKeygenError::new("invalid params", err))?;
|
||||
let private_key = key.sign(|| "".into()).expect("failed to sign secret key");
|
||||
let private_key = key
|
||||
.sign(|| "".into())
|
||||
.map_err(|err| PgpKeygenError::new("failed to sign secret key", err))?;
|
||||
|
||||
let public_key = private_key.public_key();
|
||||
let public_key = public_key
|
||||
|
||||
Reference in New Issue
Block a user