2 * Copyright (c) 2015 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:
38 case WIDGET_ERROR_INVALID_PARAMETER:
39 return "INVALID_PARAMETER";
41 case WIDGET_ERROR_OUT_OF_MEMORY:
42 return "OUT_OF_MEMORY";
44 case WIDGET_ERROR_RESOURCE_BUSY:
45 return "RESOURCE_BUSY";
47 case WIDGET_ERROR_PERMISSION_DENIED:
48 return "PERMISSION_DENIED";
50 case WIDGET_ERROR_CANCELED:
53 case WIDGET_ERROR_IO_ERROR:
56 case WIDGET_ERROR_TIMED_OUT:
59 case WIDGET_ERROR_NOT_SUPPORTED:
60 return "NOT_SUPPORTED";
62 case WIDGET_ERROR_FILE_NO_SPACE_ON_DEVICE:
63 return "FILE_NO_SPACE_ON_DEVICE";
65 case WIDGET_ERROR_FAULT:
68 case WIDGET_ERROR_ALREADY_EXIST:
69 return "ALREADY_EXIST";
71 case WIDGET_ERROR_ALREADY_STARTED:
72 return "ALREADY_STARTED";
74 case WIDGET_ERROR_NOT_EXIST:
77 case WIDGET_ERROR_DISABLED:
85 int widget_app_error(widget_error_e error, const char* function,
86 const char *description)
89 LOGE("[%s] %s(0x%08x) : %s", function, widget_app_error_to_string(error), error,
92 LOGE("[%s] %s(0x%08x)", function, widget_app_error_to_string(error), error);