diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-26 07:48:30 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-26 12:26:47 +0000 |
| commit | a0593e3aa9b19b9ca3c3881cbe0d9d207fe46d2c (patch) | |
| tree | 3482e7c558eff09cc91604ad6ddcd02cf2c94699 /src/lib/login/existing.rs | |
| parent | 1332c625b75fce616e06b415c99a068bc45c8210 (diff) | |
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
Diffstat (limited to 'src/lib/login/existing.rs')
| -rw-r--r-- | src/lib/login/existing.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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( | |||
| 81 | break; | 81 | break; |
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | result.context("cannot get or find signer info in cli arguments, local git config or global git config")? | 84 | result.context("failed to get or find signer info in cli arguments, local git config or global git config")? |
| 85 | } | 85 | } |
| 86 | Some(SignerInfoSource::CommandLineArguments) => { | 86 | Some(SignerInfoSource::CommandLineArguments) => { |
| 87 | if let Some(signer_info) = signer_info { | 87 | if let Some(signer_info) = signer_info { |
| 88 | (signer_info.clone(), SignerInfoSource::CommandLineArguments) | 88 | (signer_info.clone(), SignerInfoSource::CommandLineArguments) |
| 89 | } else { | 89 | } else { |
| 90 | bail!("cannot get signer from cli signer arguments because none were specified") | 90 | bail!("failed to get signer from cli signer arguments because none were specified") |
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | Some(SignerInfoSource::GitLocal) => { | 93 | Some(SignerInfoSource::GitLocal) => { |
| @@ -169,7 +169,9 @@ async fn get_signer( | |||
| 169 | password.clone() | 169 | password.clone() |
| 170 | } else { | 170 | } else { |
| 171 | if !prompt_for_ncryptsec_password { | 171 | if !prompt_for_ncryptsec_password { |
| 172 | bail!("cannot login without prompts a nsec is encrypted with a password"); | 172 | bail!( |
| 173 | "failed to login without prompts a nsec is encrypted with a password" | ||
| 174 | ); | ||
| 173 | } | 175 | } |
| 174 | Interactor::default() | 176 | Interactor::default() |
| 175 | .password(PromptPasswordParms::default().with_prompt("password")) | 177 | .password(PromptPasswordParms::default().with_prompt("password")) |