Skip to content

Commit

Permalink
Error handling for password
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Sep 18, 2024
1 parent 061f0d8 commit 184e28f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion validator_manager/src/import_validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ async fn run<'a>(config: ImportConfig) -> Result<(), String> {
voting_keystore: KeystoreJsonStr(
Keystore::from_json_file(&validators_file_path).map_err(|e| format!("{e:?}"))?,
),
voting_keystore_password: password.expect("Password is required"),
voting_keystore_password: password.ok_or_else(|| {
"The --password flag is required to supply the keystore password".to_string()
})?,
slashing_protection: None,
fee_recipient,
gas_limit,
Expand Down

0 comments on commit 184e28f

Please sign in to comment.