1 /* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
16 * @file client-error.cpp
17 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
19 * @brief This file contains example of ckm-manager client implementation
21 #include <ckm/ckm-error.h>
22 #include <ckm/ckm-type.h>
24 #define ERRORDESCRIBE(name) case name: return #name
27 __attribute__ ((visibility ("default")))
28 const char * ErrorToString(int error) {
30 ERRORDESCRIBE(CKM_API_SUCCESS);
31 ERRORDESCRIBE(CKM_API_ERROR_SOCKET);
32 ERRORDESCRIBE(CKM_API_ERROR_BAD_REQUEST);
33 ERRORDESCRIBE(CKM_API_ERROR_BAD_RESPONSE);
34 ERRORDESCRIBE(CKM_API_ERROR_SEND_FAILED);
35 ERRORDESCRIBE(CKM_API_ERROR_RECV_FAILED);
36 ERRORDESCRIBE(CKM_API_ERROR_AUTHENTICATION_FAILED);
37 ERRORDESCRIBE(CKM_API_ERROR_INPUT_PARAM);
38 ERRORDESCRIBE(CKM_API_ERROR_BUFFER_TOO_SMALL);
39 ERRORDESCRIBE(CKM_API_ERROR_OUT_OF_MEMORY);
40 ERRORDESCRIBE(CKM_API_ERROR_ACCESS_DENIED);
41 ERRORDESCRIBE(CKM_API_ERROR_SERVER_ERROR);
42 ERRORDESCRIBE(CKM_API_ERROR_DB_LOCKED);
43 ERRORDESCRIBE(CKM_API_ERROR_DB_ERROR);
44 ERRORDESCRIBE(CKM_API_ERROR_DB_ALIAS_EXISTS);
45 ERRORDESCRIBE(CKM_API_ERROR_DB_ALIAS_UNKNOWN);
46 ERRORDESCRIBE(CKM_API_ERROR_VERIFICATION_FAILED);
47 ERRORDESCRIBE(CKM_API_ERROR_UNKNOWN);
49 return "Error not defined";