2 * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include <widget_errno.h>
24 #include "widget-private.h"
30 #define LOG_TAG "CAPI_WIDGET_APPLICATIO"
32 static const char *widget_app_error_to_string(widget_error_e error)
35 case WIDGET_ERROR_NONE:
37 case WIDGET_ERROR_INVALID_PARAMETER:
38 return "INVALID_PARAMETER";
39 case WIDGET_ERROR_OUT_OF_MEMORY:
40 return "OUT_OF_MEMORY"; /* LCOV_EXCL_LINE */
41 case WIDGET_ERROR_RESOURCE_BUSY:
42 return "RESOURCE_BUSY"; /* LCOV_EXCL_LINE */
43 case WIDGET_ERROR_PERMISSION_DENIED:
44 return "PERMISSION_DENIED"; /* LCOV_EXCL_LINE */
45 case WIDGET_ERROR_CANCELED:
46 return "CANCELED"; /* LCOV_EXCL_LINE */
47 case WIDGET_ERROR_IO_ERROR:
48 return "IO_ERROR"; /* LCOV_EXCL_LINE */
49 case WIDGET_ERROR_TIMED_OUT:
50 return "TIMED_OUT"; /* LCOV_EXCL_LINE */
51 case WIDGET_ERROR_NOT_SUPPORTED:
52 return "NOT_SUPPORTED"; /* LCOV_EXCL_LINE */
53 case WIDGET_ERROR_FILE_NO_SPACE_ON_DEVICE:
54 return "FILE_NO_SPACE_ON_DEVICE"; /* LCOV_EXCL_LINE */
55 case WIDGET_ERROR_FAULT:
56 return "FAULT"; /* LCOV_EXCL_LINE */
57 case WIDGET_ERROR_ALREADY_EXIST:
58 return "ALREADY_EXIST"; /* LCOV_EXCL_LINE */
59 case WIDGET_ERROR_ALREADY_STARTED:
60 return "ALREADY_STARTED"; /* LCOV_EXCL_LINE */
61 case WIDGET_ERROR_NOT_EXIST:
62 return "NOT_EXIST"; /* LCOV_EXCL_LINE */
63 case WIDGET_ERROR_DISABLED:
64 return "DISABLED"; /* LCOV_EXCL_LINE */
66 return "UNKNOWN"; /* LCOV_EXCL_LINE */
70 int widget_app_error(widget_error_e error, const char *function,
71 const char *description)
74 LOGE("[%s] %s(0x%08x) : %s", function,
75 widget_app_error_to_string(error), error,
78 LOGE("[%s] %s(0x%08x)", function,
79 widget_app_error_to_string(error), error);