diff options
author | Conrad Ludgate <conradludgate@gmail.com> | 2021-11-17 11:50:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 11:50:34 +0000 |
commit | f539f60ae420f9ac8ae6dd4a82b13c505bc9005a (patch) | |
tree | f18fc332ea2be2fd48fed8969a31a855402f6f43 /src/command | |
parent | 2e59d6a588661f527edb6ca49f14fc2dab1e436a (diff) |
chore: add more eyre contexts (#200)
* chore: add more eyre contexts
* chore: rustfmt
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/command/mod.rs b/src/command/mod.rs index 6a79a32f6..029503653 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use eyre::Result; +use eyre::{Result, WrapErr}; use structopt::StructOpt; use atuin_client::database::Sqlite; @@ -96,8 +96,8 @@ pub enum AtuinCmd { impl AtuinCmd { pub async fn run(self) -> Result<()> { - let client_settings = ClientSettings::new()?; - let server_settings = ServerSettings::new()?; + let client_settings = ClientSettings::new().wrap_err("could not load client settings")?; + let server_settings = ServerSettings::new().wrap_err("could not load server settings")?; let db_path = PathBuf::from(client_settings.db_path.as_str()); @@ -151,8 +151,10 @@ impl AtuinCmd { register::run(&client_settings, &r.username, &r.email, &r.password) } Self::Key => { - let key = atuin_client::encryption::load_key(&client_settings)?; - println!("{}", atuin_client::encryption::encode_key(key)?); + use atuin_client::encryption::{encode_key, load_key}; + let key = load_key(&client_settings).wrap_err("could not load encryption key")?; + let encode = encode_key(key).wrap_err("could not encode encryption key")?; + println!("{}", encode); Ok(()) } |