diff options
author | Werner Koch <[email protected]> | 2015-12-14 18:35:03 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-12-15 12:40:10 +0000 |
commit | 2ea1aebc924c3f0b2269f83cb1b80c75d9fa069c (patch) | |
tree | e4deb768059ed642a19b580ab24ad535778373b5 /common/xasprintf.c | |
parent | gpg: Improve the keyblock cache's transparency. (diff) | |
download | gnupg-2ea1aebc924c3f0b2269f83cb1b80c75d9fa069c.tar.gz gnupg-2ea1aebc924c3f0b2269f83cb1b80c75d9fa069c.zip |
gpg: New function to printed a detailed error code.
* g10/misc.c (print_reported_error): New.
--
Often the user is only interested in a catch all error code like "not
found" but sometimes it is useful to also see the real reason. By
this function this can easily be achieved. Example:
err = search_for_key (keyid)
if (err)
{
log_info ("error locating key '%s': %s\n",
keyid, gpg_strerror (GPG_ERR_NOT_FOUND));
print_reported_error (err, GPG_ERR_NOT_FOUND);
}
results in
gpg: error locating key 'foobar': not found
gpg: (reported error: no keyring <keybox>)
where the second line is only printed in verbose mode and if ERR is
not GPG_ERR_NOT_FOUND.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/xasprintf.c')
0 files changed, 0 insertions, 0 deletions