Skip to content

Commit 5fc2eda

Browse files
author
replydev
committed
Fix panic on edit element
1 parent 5560ec7 commit 5fc2eda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/argument_functions.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ pub fn edit(args: Vec<String>){
7474
let secret = &args[3];
7575
let issuer = &args[4];
7676
let label = &args[5];
77-
database_loader::edit_element(id, &secret, &issuer, &label).expect("An error occured");
77+
match database_loader::edit_element(id, &secret, &issuer, &label){
78+
Ok(()) => println!("Success"),
79+
Err(e) => println!("An error occurred: {}",e)
80+
}
7881
}
7982
else{
8083
println!("Invalid arguments, type cotp --edit <id> <secret> <issuer> <label>\n\nReplace the attribute value with \".\" to skip the attribute modification");

0 commit comments

Comments
 (0)