summaryrefslogtreecommitdiffstats
path: root/g10/revoke.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2015-11-20 12:17:13 +0100
committerNeal H. Walfield <neal@g10code.com>2015-11-20 12:17:13 +0100
commit46e128d44a0456dc603bc9e25a4c5d8da903b078 (patch)
treee2b92ea7a640fb2764d09e73dda7f0d219d12481 /g10/revoke.c
parentdirmngr: Improve error handling. (diff)
downloadgnupg2-46e128d44a0456dc603bc9e25a4c5d8da903b078.tar.xz
gnupg2-46e128d44a0456dc603bc9e25a4c5d8da903b078.zip
gpg: Improve an error message.
* g10/revoke.c (gen_revoke): Provide a more descriptive error message if searching for a key fails. -- Signed-off-by: Neal H. Walfield <neal@g10code.com> GnuPG-bug-id: 1987
Diffstat (limited to 'g10/revoke.c')
-rw-r--r--g10/revoke.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/g10/revoke.c b/g10/revoke.c
index 460f346b7..0ed2604ed 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -614,8 +614,12 @@ gen_revoke (const char *uname)
rc = keydb_search (kdbhd, &desc, 1, NULL);
if (rc)
{
- log_error (_("secret key \"%s\" not found: %s\n"),
- uname, gpg_strerror (rc));
+ if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
+ log_error (_("no secret key matches the search term \"%s\"\n"),
+ uname);
+ else
+ log_error (_("error looking up secret key \"%s\": %s\n"),
+ uname, gpg_strerror (rc));
goto leave;
}