diff --git a/cmd/soroban-cli/src/config/secret.rs b/cmd/soroban-cli/src/config/secret.rs index 1281688f9..107bec159 100644 --- a/cmd/soroban-cli/src/config/secret.rs +++ b/cmd/soroban-cli/src/config/secret.rs @@ -32,6 +32,8 @@ pub enum Error { LedgerDoesNotRevealSecretKey, #[error(transparent)] Keyring(#[from] keyring::Error), + #[error("Secure Store does not reveal secret key")] + SecureStoreDoesNotRevealSecretKey, } #[derive(Debug, clap::Args, Clone)] @@ -129,8 +131,12 @@ impl Secret { .private() .0, )?, - Secret::Ledger => panic!("Ledger does not reveal secret key"), - Secret::SecureStore { .. } => panic!("Secure Store does not reveal secret key"), + Secret::Ledger => { + return Err(Error::LedgerDoesNotRevealSecretKey); + } + Secret::SecureStore { .. } => { + return Err(Error::SecureStoreDoesNotRevealSecretKey); + } }) }