From a0593e3aa9b19b9ca3c3881cbe0d9d207fe46d2c Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 26 Nov 2024 07:48:30 +0000 Subject: refactor: err msgs 'cannot' > 'failed to' in nearly all cases 'cannot' was used when an action was tried and failed. 'failed to' is strictly better because: * just because the action didn't work that time doesnt mean it cannot work * it is better at drawing the users attention to a problem --- src/lib/login/existing.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib/login/existing.rs') diff --git a/src/lib/login/existing.rs b/src/lib/login/existing.rs index e388a34..342f792 100644 --- a/src/lib/login/existing.rs +++ b/src/lib/login/existing.rs @@ -81,13 +81,13 @@ fn get_signer_info( break; } } - result.context("cannot get or find signer info in cli arguments, local git config or global git config")? + result.context("failed to get or find signer info in cli arguments, local git config or global git config")? } Some(SignerInfoSource::CommandLineArguments) => { if let Some(signer_info) = signer_info { (signer_info.clone(), SignerInfoSource::CommandLineArguments) } else { - bail!("cannot get signer from cli signer arguments because none were specified") + bail!("failed to get signer from cli signer arguments because none were specified") } } Some(SignerInfoSource::GitLocal) => { @@ -169,7 +169,9 @@ async fn get_signer( password.clone() } else { if !prompt_for_ncryptsec_password { - bail!("cannot login without prompts a nsec is encrypted with a password"); + bail!( + "failed to login without prompts a nsec is encrypted with a password" + ); } Interactor::default() .password(PromptPasswordParms::default().with_prompt("password")) -- cgit v1.2.3