diff options
author | Werner Koch <[email protected]> | 2001-12-05 23:45:42 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2001-12-05 23:45:42 +0000 |
commit | 64c36057ebb82486eb94949e82fb4b9f5b6b789a (patch) | |
tree | 99dab0d09c819efd48328222f547773ed8251d8f /common/maperror.c | |
parent | assuan-connect.c (assuan_pipe_connect): Add more error reporting. (diff) | |
download | gnupg-64c36057ebb82486eb94949e82fb4b9f5b6b789a.tar.gz gnupg-64c36057ebb82486eb94949e82fb4b9f5b6b789a.zip |
New error codes and another mapping fnc.
Diffstat (limited to 'common/maperror.c')
-rw-r--r-- | common/maperror.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/common/maperror.c b/common/maperror.c index 894e235ca..aba0ee750 100644 --- a/common/maperror.c +++ b/common/maperror.c @@ -30,7 +30,7 @@ #include "util.h" #include "errors.h" - +#include "../assuan/assuan.h" /* Note: we might want to wrap this in a macro to get our hands on the line and file where the error occired */ @@ -83,3 +83,25 @@ map_kbx_err (int err) return err; } + +int +map_assuan_err (int err) +{ + switch (err) + { + case -1: + case 0: + break; + + case ASSUAN_Not_Implemented: err = GNUPG_Not_Implemented; break; + case ASSUAN_Server_Fault: err = GNUPG_Assuan_Server_Fault; break; + case ASSUAN_No_Public_Key: err = GNUPG_No_Public_Key; break; + case ASSUAN_No_Secret_Key: err = GNUPG_No_Secret_Key; break; + + default: + err = err < 100? GNUPG_Assuan_Server_Fault : GNUPG_Assuan_Error; + break; + } + return err; +} + |