1 /* maperror.c - Error mapping
2 * Copyright (C) 2001 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GnuPG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
33 #include "../assuan/assuan.h"
35 /* Note: we might want to wrap this in a macro to get our hands on
36 the line and file where the error occired */
38 map_ksba_err (int err)
46 case KSBA_Unsupported_Algorithm: err = GNUPG_Unsupported_Algorithm; break;
49 err = seterr (General_Error);
57 map_gcry_err (int err)
66 err = seterr (General_Error);
82 err = seterr (General_Error);
90 map_assuan_err (int err)
98 case ASSUAN_Not_Implemented: err = GNUPG_Not_Implemented; break;
99 case ASSUAN_Server_Fault: err = GNUPG_Assuan_Server_Fault; break;
100 case ASSUAN_No_Public_Key: err = GNUPG_No_Public_Key; break;
101 case ASSUAN_No_Secret_Key: err = GNUPG_No_Secret_Key; break;
104 err = err < 100? GNUPG_Assuan_Server_Fault : GNUPG_Assuan_Error;