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:
edgerunnergit 2024-02-07 02:02:06 +05:30 committed by GitHub
parent 8fb389fe8d
commit 19454bf56e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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 {