From 9aab0b9388b76a94ac092dbdda700a6bc8169eea Mon Sep 17 00:00:00 2001 From: Jack May Date: Wed, 1 Apr 2020 11:13:31 -0700 Subject: [PATCH] More custom error rename (#9227) automerge --- cli/src/cli.rs | 2 +- remote-wallet/src/remote_wallet.rs | 8 ++++---- sdk/src/signature.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 6f2a7233f..8fd487290 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -537,7 +537,7 @@ impl CliConfig<'_> { if !self.signers.is_empty() { self.signers[0].try_pubkey() } else { - Err(SignerError::CustomError( + Err(SignerError::Custom( "Default keypair must be set if pubkey arg not provided".to_string(), )) } diff --git a/remote-wallet/src/remote_wallet.rs b/remote-wallet/src/remote_wallet.rs index 496e7f78e..b498eb1eb 100644 --- a/remote-wallet/src/remote_wallet.rs +++ b/remote-wallet/src/remote_wallet.rs @@ -60,16 +60,16 @@ impl From for RemoteWalletError { impl From for SignerError { fn from(err: RemoteWalletError) -> SignerError { match err { - RemoteWalletError::Hid(hid_error) => SignerError::ConnectionError(hid_error), - RemoteWalletError::DeviceTypeMismatch => SignerError::ConnectionError(err.to_string()), - RemoteWalletError::InvalidDevice => SignerError::ConnectionError(err.to_string()), + RemoteWalletError::Hid(hid_error) => SignerError::Connection(hid_error), + RemoteWalletError::DeviceTypeMismatch => SignerError::Connection(err.to_string()), + RemoteWalletError::InvalidDevice => SignerError::Connection(err.to_string()), RemoteWalletError::InvalidInput(input) => SignerError::InvalidInput(input), RemoteWalletError::NoDeviceFound => SignerError::NoDeviceFound, RemoteWalletError::Protocol(e) => SignerError::Protocol(e.to_string()), RemoteWalletError::UserCancel => { SignerError::UserCancel("remote wallet operation rejected by the user".to_string()) } - _ => SignerError::CustomError(err.to_string()), + _ => SignerError::Custom(err.to_string()), } } } diff --git a/sdk/src/signature.rs b/sdk/src/signature.rs index 8117b69d7..6b13f10b4 100644 --- a/sdk/src/signature.rs +++ b/sdk/src/signature.rs @@ -202,7 +202,7 @@ pub enum SignerError { TransactionError(#[from] TransactionError), #[error("custom error: {0}")] - CustomError(String), + Custom(String), // Presigner-specific Errors #[error("presigner error")] @@ -210,7 +210,7 @@ pub enum SignerError { // Remote Keypair-specific Errors #[error("connection error: {0}")] - ConnectionError(String), + Connection(String), #[error("invalid input: {0}")] InvalidInput(String),