Show error instead of panic on passphrase mismatch during solana-keygen (#35072)
* Show error instead of panic on passphrase mismatch * Format code
This commit is contained in:
parent
8fb389fe8d
commit
19454bf56e
|
@ -488,7 +488,8 @@ fn do_main(matches: &ArgMatches) -> Result<(), Box<dyn error::Error>> {
|
|||
let derivation_path = acquire_derivation_path(matches)?;
|
||||
|
||||
let mnemonic = Mnemonic::new(mnemonic_type, language);
|
||||
let (passphrase, passphrase_message) = acquire_passphrase_and_message(matches).unwrap();
|
||||
let (passphrase, passphrase_message) = acquire_passphrase_and_message(matches)
|
||||
.map_err(|err| format!("Unable to acquire passphrase: {err}"))?;
|
||||
|
||||
let seed = Seed::new(&mnemonic, &passphrase);
|
||||
let keypair = match derivation_path {
|
||||
|
|
Loading…
Reference in New Issue