[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Many functions in GPGME can return an error if they fail. For this reason, the application should always catch the error condition and take appropriate measures, for example by releasing the resources and passing the error up to the caller, or by displaying a descriptive message to the user and cancelling the operation.
Some error values do not indicate a system error or an error in the operation, but the result of an operation that failed properly. For example, if you try to decrypt a tempered message, the decryption will fail. Another error value actually means that the end of a data buffer or list has been reached. The following descriptions explain what each error message means in general. Some error values have specific meanings if returned by a specific function. Such cases are described in the documentation of those functions.
4.1 Error Values A list of all error values used. 4.2 Error Strings How to get a descriptive string from a value.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GpgmeError
type specifies the set of all error values that
are used by GPGME. Possible values are:
GPGME_EOF
GPGME_No_Error
0
.
GPGME_General_Error
GPGME_Out_Of_Core
GPGME_Invalid_Value
GpgmeData
object was expected, but one containing data was provided, this error
value is returned.
GPGME_Busy
GPGME_No_Request
GPGME_Busy
. There
is no pending operation, but it is required for the function to
succeed.
GPGME_Exec_Error
GPGME_Too_Many_Procs
GPGME_Pipe_Error
GPGME_No_Recipients
GPGME_Invalid_Recipients
GPGME_No_Data
GpgmeData
object which was expected to
have content was found empty.
GPGME_Conflict
GPGME_Not_Implemented
GPGME_Read_Error
GPGME_Write_Error
GPGME_Invalid_Type
GpgmeData
object.
GPGME_Invalid_Mode
GpgmeData
object has an incorrect mode
of operation (for example, doesn't support output although it is
attempted to use it as an output buffer).
GPGME_File_Error
errno
contains the system error value.
GPGME_Decryption_Failed
GPGME_No_Passphrase
GPGME_Canceled
GPGME_Invalid_Key
GPGME_Invalid_Engine
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gpgme_strerror
returns a pointer to a statically
allocated string containing a description of the error with the error
value err. This string can be used to output a diagnostic
message to the user.
The following example illustrates the use of gpgme_strerror
:
GpgmeCtx ctx; GpgmeError err = gpgme_new (&ctx); if (err) { fprintf (stderr, "%s: creating GpgME context failed: %s\n", argv[0], gpgme_strerror (err)); exit (1); } |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |