Skip to content

Commit

Permalink
use anyhow! macro to build errors
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Detjens <[email protected]>
  • Loading branch information
detjensrobert committed Jun 19, 2024
1 parent e169c34 commit 647bd0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/commands/check_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ fn check_profile(
results
.into_iter()
.collect::<Result<_>>()
.with_context(|| format!("error in profile {profile_name}:"))
.with_context(|| format!("error in profile {profile_name}"))
}
6 changes: 2 additions & 4 deletions src/configparser/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod challenge;
pub mod config;

use anyhow::{Error, Result};
use anyhow::{anyhow, Error, Result};
use itertools::Itertools;
use simplelog::*;
use std::sync::OnceLock;
Expand Down Expand Up @@ -31,9 +31,7 @@ pub fn get_profile_config(profile_name: &str) -> Result<&config::ProfileConfig>
get_config()?
.profiles
.get(profile_name)
.ok_or(Error::msg(format!(
"profile {profile_name} not found in config"
)))
.ok_or(anyhow!("profile {profile_name} not found in config"))
}

/// get challenges from global, or load from files if not parsed yet
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() {
)
.unwrap();

debug!("args: {:?}", cli);
trace!("args: {:?}", cli);

// dispatch commands
match &cli.command {
Expand Down

0 comments on commit 647bd0f

Please sign in to comment.