Moved error handling to one function
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use crate::prelude::*;
|
||||
use log::error;
|
||||
|
||||
/// Gets the master password, deletes the accounts and the master password from DB.
|
||||
/// Although it doesn't use the master password, we get it to be sure that it's the user who used that command
|
||||
@@ -27,8 +26,10 @@ async fn get_master_pass(
|
||||
&locale.everything_was_deleted
|
||||
}
|
||||
(Err(err), _) | (_, Err(err)) => {
|
||||
error!("{:?}", crate::Error::from(err));
|
||||
txn.rollback().await?;
|
||||
handle_error(err);
|
||||
if let Err(err) = txn.rollback().await {
|
||||
handle_error(err);
|
||||
}
|
||||
&locale.something_went_wrong
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user