summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nitrocli/src/pinentry.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs
index d8a77d4..0733cd1 100644
--- a/nitrocli/src/pinentry.rs
+++ b/nitrocli/src/pinentry.rs
@@ -19,6 +19,7 @@
use std::borrow;
use std::fmt;
+use std::io;
use std::process;
use std::str;
@@ -263,7 +264,13 @@ where
let output = process::Command::new("gpg-connect-agent")
.arg(command)
.arg("/bye")
- .output()?;
+ .output()
+ .map_err(|err| match err.kind() {
+ io::ErrorKind::NotFound => {
+ io::Error::new(io::ErrorKind::NotFound, "gpg-connect-agent not found")
+ }
+ _ => err,
+ })?;
parse_pinentry_pin(str::from_utf8(&output.stdout)?)
}