From 315643f949eb67c07186ed6ca1099add355b2cb5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 11 Apr 2020 02:28:34 -0400 Subject: fix errors --- src/bin/rbw.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/rbw.rs b/src/bin/rbw.rs index 9578266..e23d005 100644 --- a/src/bin/rbw.rs +++ b/src/bin/rbw.rs @@ -39,7 +39,7 @@ fn recv(sock: &mut std::os::unix::net::UnixStream) -> rbw::agent::Response { serde_json::from_str(&line).unwrap() } -fn single_action(action: rbw::agent::Action) { +fn single_action(action: rbw::agent::Action, desc: &str) { let mut sock = connect(); send( @@ -54,7 +54,7 @@ fn single_action(action: rbw::agent::Action) { match res { rbw::agent::Response::Ack => (), rbw::agent::Response::Error { error } => { - panic!("failed to login: {}", error) + panic!("failed to {}: {}", desc, error) } _ => panic!("unexpected message: {:?}", res), } @@ -103,19 +103,19 @@ fn config_set(key: &str, value: &str) { fn login() { ensure_agent(); - single_action(rbw::agent::Action::Login); + single_action(rbw::agent::Action::Login, "login"); } fn unlock() { ensure_agent(); - single_action(rbw::agent::Action::Unlock); + single_action(rbw::agent::Action::Unlock, "unlock"); } fn sync() { ensure_agent(); - single_action(rbw::agent::Action::Sync); + single_action(rbw::agent::Action::Sync, "sync"); } fn list() { @@ -179,7 +179,7 @@ fn remove() { fn lock() { ensure_agent(); - single_action(rbw::agent::Action::Lock); + single_action(rbw::agent::Action::Lock, "lock"); } fn purge() { -- cgit v1.2.3-54-g00ecf