diff options
author | Neal H. Walfield <neal@sequoia-pgp.org> | 2024-03-09 20:32:42 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@sequoia-pgp.org> | 2024-03-09 20:34:24 +0100 |
commit | 0ee88083dfb649fa367f18082222cdeabcda63a8 (patch) | |
tree | 3cc35430d2e89f22ce5c55ccafe0f6762baa3ee2 | |
parent | 02bf980e2283b64a51ba2e290bf58fda54bbd4a7 (diff) |
ipc: Improve error message.
- If we can't open the socket, include the socket's file name as
context.
-rw-r--r-- | ipc/src/assuan/socket/windows.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ipc/src/assuan/socket/windows.rs b/ipc/src/assuan/socket/windows.rs index 02841e09..0ae207de 100644 --- a/ipc/src/assuan/socket/windows.rs +++ b/ipc/src/assuan/socket/windows.rs @@ -48,7 +48,9 @@ pub enum UdsEmulation { /// /// Inspired by `read_port_and nonce` from assuan-socket.c. pub fn read_port_and_nonce(fname: &Path) -> Result<Rendezvous> { - let mut file = File::open(fname)?; + let mut file = File::open(fname).with_context(|| { + format!("Opening gpg-agent socket {}", fname.display()) + })?; // Socket connection info will be in either a <= 54 byte long Cygwin format // or ~5+1+16 (modulo whitespace separators) custom libassuan format let mut contents = Vec::with_capacity(64); |