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/client.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/lib/client.rs') diff --git a/src/lib/client.rs b/src/lib/client.rs index a8b48f4..7093dd5 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs @@ -176,7 +176,7 @@ impl Connect for Client { self.client .add_relay(relay_url) .await - .context("cannot add relay")?; + .context("failed to add relay")?; let relay = self.client.relay(relay_url).await?; @@ -263,7 +263,7 @@ impl Connect for Client { self.client .add_relay(relay.as_str()) .await - .context("cannot add relay")?; + .context("failed to add relay")?; } let relays_map = self.client.relays().await; @@ -374,7 +374,7 @@ impl Connect for Client { self.client .add_relay(relay.as_str()) .await - .context("cannot add relay")?; + .context("failed to add relay")?; } let dim = Style::new().color256(247); @@ -741,7 +741,7 @@ fn pb_after_style(succeed: bool) -> indicatif::ProgressStyle { async fn get_local_cache_database(git_repo_path: &Path) -> Result { NostrLMDB::open(git_repo_path.join(".git/nostr-cache.lmdb")) - .context("cannot open or create nostr cache database at .git/nostr-cache.lmdb") + .context("failed to open or create nostr cache database at .git/nostr-cache.lmdb") } async fn get_global_cache_database(git_repo_path: Option<&Path>) -> Result { @@ -753,13 +753,13 @@ async fn get_global_cache_database(git_repo_path: Option<&Path>) -> Result ) .await? .first() - .context("cannot find event in cache")? + .context("failed to find event in cache")? .clone()) } -- cgit v1.2.3