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";
41 case WIDGET_ERROR_RESOURCE_BUSY:
42 return "RESOURCE_BUSY";
43 case WIDGET_ERROR_PERMISSION_DENIED:
44 return "PERMISSION_DENIED";
45 case WIDGET_ERROR_CANCELED:
47 case WIDGET_ERROR_IO_ERROR:
49 case WIDGET_ERROR_TIMED_OUT:
51 case WIDGET_ERROR_NOT_SUPPORTED:
52 return "NOT_SUPPORTED";
53 case WIDGET_ERROR_FILE_NO_SPACE_ON_DEVICE:
54 return "FILE_NO_SPACE_ON_DEVICE";
55 case WIDGET_ERROR_FAULT:
57 case WIDGET_ERROR_ALREADY_EXIST:
58 return "ALREADY_EXIST";
59 case WIDGET_ERROR_ALREADY_STARTED:
60 return "ALREADY_STARTED";
61 case WIDGET_ERROR_NOT_EXIST:
63 case WIDGET_ERROR_DISABLED:
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);