f1e9cba9b0fe94c5477b1cfee9b59cd8ee483e11
[platform/core/api/common.git] / include / tizen_error.h
1 /*
2  * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __TIZEN_COMMON_ERROR_H__
18 #define __TIZEN_COMMON_ERROR_H__
19
20 #include <errno.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @addtogroup CAPI_COMMON_ERROR
28  * @{
29  */
30
31 #define TIZEN_ERROR_MAX_PLATFORM_ERROR 0
32 #define TIZEN_ERROR_MIN_PLATFORM_ERROR (-1073741824LL)  /* = -2147483648 / 2 */
33
34 /* Use this constant macro as the value of the first module specific error */
35 #define TIZEN_ERROR_MIN_MODULE_ERROR (-2147483648LL)
36
37 /* Module errors cannot be greater than the following constant */
38 #define TIZEN_ERROR_MAX_MODULE_ERROR (TIZEN_ERROR_MIN_PLATFORM_ERROR - 1)
39
40 /* Check if error or not */
41 #define TIZEN_ERROR_IS_OK(x) (0 <= (x))
42
43 /* Check if error or not */
44 #define TIZEN_ERROR_IS_ERROR(x) (!TIZEN_ERROR_IS_OK(x))
45
46 /* Check if tizen error or not */
47 #define TIZEN_ERROR_IS_PLATFORM_ERROR(x) (TIZEN_ERROR_MIN_PLATFORM_ERROR <= (x) && (x) < 0)
48
49 /* Application Error Class */
50 #define TIZEN_ERROR_APPLICATION_CLASS -0x00000200
51 /* Base Error Class */
52 #define TIZEN_ERROR_BASE_CLASS -0x00000400
53 /* Content Error Class */
54 #define TIZEN_ERROR_CONTENT_CLASS -0x00000800
55 /* Location Error Class */
56 #define TIZEN_ERROR_LOCATION_CLASS -0x00001000
57 /* Multimedia Error Class */
58 #define TIZEN_ERROR_MULTIMEDIA_CLASS -0x00002000
59 /* Messaging Error Class */
60 #define TIZEN_ERROR_MESSAGING_CLASS -0x00004000
61 /* Network Error Class */
62 #define TIZEN_ERROR_NETWORK_CLASS -0x00008000
63 /* Social Error Class */
64 #define TIZEN_ERROR_SOCIAL_CLASS -0x00010000
65 /* System Error Class */
66 #define TIZEN_ERROR_SYSTEM_CLASS -0x00020000
67 /* Telephony Error Class */
68 #define TIZEN_ERROR_TELEPHONY_CLASS -0x00040000
69 /* UI Error class */
70 #define TIZEN_ERROR_UI_CLASS -0x00080000
71 /* UIX Error class */
72 #define TIZEN_ERROR_UIX_CLASS -0x00100000
73 /* AD Error class */
74 #define TIZEN_ERROR_AD_CLASS -0x00200000
75 /* Web Error class */
76 #define TIZEN_ERROR_WEB_CLASS -0x00400000
77 /* DRM Error class */
78 #define TIZEN_ERROR_DRM_CLASS -0x00800000
79 /* Account Error class */
80 #define TIZEN_ERROR_ACCOUNT_CLASS -0x01000000
81
82 /* Tizen Account Error */
83 #define TIZEN_ERROR_ACCOUNT             -0x01000000
84 /* Tizen Account Oauth Error */
85 #define TIZEN_ERROR_ACCOUNT_OAUTH       -0x01010000
86 /* Tizen SYNC MANAGER Error */
87 #define TIZEN_ERROR_SYNC_MANAGER        -0x01020000
88 /* Tizen FIDO Error */
89 #define TIZEN_ERROR_FIDO                -0x01030000
90 /* Tizen Application Error */
91 #define TIZEN_ERROR_APPLICATION         -0x01100000
92 /* Tizen Application Manager Error */
93 #define TIZEN_ERROR_APPLICATION_MANAGER -0x01110000
94 /* Tizen Badge Error */
95 #define TIZEN_ERROR_BADGE               -0x01120000
96 /* Tizen Message Port Error */
97 #define TIZEN_ERROR_MESSAGE_PORT        -0x01130000
98 /* Tizen Notification Error */
99 #define TIZEN_ERROR_NOTIFICATION        -0x01140000
100 /* Tizen Package Manager Error */
101 #define TIZEN_ERROR_PACKAGE_MANAGER     -0x01150000
102 /* Tizen Shortcut Error */
103 #define TIZEN_ERROR_SHORTCUT            -0x01160000
104 /* Tizen Bundle Error */
105 #define TIZEN_ERROR_BUNDLE              -0x01180000
106 /* Tizen Data Control Error */
107 #define TIZEN_ERROR_DATA_CONTROL        -0x01190000
108 /* Tizen Service Application Error */
109 #define TIZEN_ERROR_SERVICE_APPLICATION  -0x01200000
110 /* Tizen MINICONTROL Error */
111 #define TIZEN_ERROR_MINICONTROL         -0x01210000
112 /* Tizen Utility ICU Error */
113 #define TIZEN_ERROR_UTILITY_ICU         -0x01500000
114 /* Tizen Mime Type Error */
115 #define TIZEN_ERROR_MIME_TYPE           -0x01600000
116 /* Tizen Media Content Error */
117 #define TIZEN_ERROR_MEDIA_CONTENT       -0x01610000
118 /* Tizen Email Service Error */
119 #define TIZEN_ERROR_EMAIL_SERVICE       -0x01700000
120 /* Tizen Messaging Service Error */
121 #define TIZEN_ERROR_MESSAGING_SERVICE   -0x01710000
122 /* Tizen Push Error */
123 #define TIZEN_ERROR_PUSH                -0x01720000
124 /* Tizen Audio IO Error */
125 #define TIZEN_ERROR_AUDIO_IO            -0x01900000
126 /* Tizen Camera Error */
127 #define TIZEN_ERROR_CAMERA              -0x01910000
128 /* Tizen Image Util Error */
129 #define TIZEN_ERROR_IMAGE_UTIL          -0x01920000
130 /* Tizen Metadata Extractor Error */
131 #define TIZEN_ERROR_METADATA_EXTRACTOR  -0x01930000
132 /* Tizen Player Error */
133 #define TIZEN_ERROR_PLAYER              -0x01940000
134 /* Tizen Recorder Error */
135 #define TIZEN_ERROR_RECORDER            -0x01950000
136 /* Tizen Sound Manager Error */
137 #define TIZEN_ERROR_SOUND_MANAGER       -0x01960000
138 /* Tizen Tone Player Error */
139 #define TIZEN_ERROR_TONE_PLAYER         -0x01970000
140 /* Tizen Video Util Error */
141 #define TIZEN_ERROR_VIDEO_UTIL          -0x01980000
142 /* Tizen Wav Player Error */
143 #define TIZEN_ERROR_WAV_PLAYER          -0x01990000
144 /* Tizen Radio Error */
145 #define TIZEN_ERROR_RADIO               -0x019A0000
146 /* Tizen MEDIA CODEC Error */
147 #define TIZEN_ERROR_MEDIACODEC          -0x019B0000
148 /* Tizen Metadata Editor Error */
149 #define TIZEN_ERROR_METADATA_EDITOR     -0x019C0000
150 /* Tizen Vision Error */
151 #define TIZEN_ERROR_MEDIA_VISION        -0x019D0000
152 /* Tizen MEDIA DEMUXER Error */
153 #define TIZEN_ERROR_MEDIA_DEMUXER        -0x019E0000
154 /* Tizen MEDIA MUXER Error */
155 #define TIZEN_ERROR_MEDIA_MUXER        -0x019F0000
156 /* Tizen MEDIA STREAMER Error */
157 #define TIZEN_ERROR_MEDIA_STREAMER        -0x01A00000
158 /* Tizen MEDIA STREAMRECORDER Error */
159 #define TIZEN_ERROR_STREAMRECORDER              -0x01A10000
160 /* Tizen MEDIA STREAMRECORDER Error */
161 #define TIZEN_ERROR_MEDIA_TOOL          -0x01A20000
162 /* Tizen Bluetooth Error */
163 #define TIZEN_ERROR_BLUETOOTH           -0x01C00000
164 /* Tizen Connection Error */
165 #define TIZEN_ERROR_CONNECTION          -0x01C10000
166 /* Tizen NFC Error */
167 #define TIZEN_ERROR_NFC                 -0x01C20000
168 /* Tizen Serial Error */
169 #define TIZEN_ERROR_SERIAL              -0x01C30000
170 /* Tizen Tethering Error */
171 #define TIZEN_ERROR_TETHERING           -0x01C40000
172 /* Tizen Wifi Error */
173 #define TIZEN_ERROR_WIFI                -0x01C50000
174 /* Tizen Wifi Direct Error */
175 #define TIZEN_ERROR_WIFI_DIRECT         -0x01C60000
176 /* Tizen Smart Card Error */
177 #define TIZEN_ERROR_SMARTCARD          -0x01C70000
178 /* Tizen IotCon Error */
179 #define TIZEN_ERROR_IOTCON              -0x01C80000
180 /* Tizen SSDP Error */
181 #define TIZEN_ERROR_SSDP                -0x01C90000
182 /* Tizen DNSSD Error */
183 #define TIZEN_ERROR_DNSSD               -0x01CA0000
184 /* Tizen VPNSVC Error */
185 #define TIZEN_ERROR_VPNSVC              -0x01CB0000
186 /* Tizen MTP Error */
187 #define TIZEN_ERROR_MTP         -0x01CC0000
188 /* Tizen Http Error */
189 #define TIZEN_ERROR_HTTP                -0x01CD0000
190 /* Tizen Wifi Manager Error */
191 #define TIZEN_ERROR_WIFI_MANAGER        -0x01CE0000
192 /* Tizen Privacy Manager Error */
193 #define TIZEN_ERROR_PRIVACY_MANAGER     -0x01E00000
194 /* Tizen Key Manager Error */
195 #define TIZEN_ERROR_KEY_MANAGER         -0x01E10000
196 /* Tizen PRIVILEGE INFO Error */
197 #define TIZEN_ERROR_PRIVILEGE_INFORMATION -0x01E20000
198 /* Tizen CSR Error */
199 #define TIZEN_ERROR_CSR -0x01E30000
200 /* Tizen Calendar Error */
201 #define TIZEN_ERROR_CALENDAR            -0x02000000
202 /* Tizen Contacts Error */
203 #define TIZEN_ERROR_CONTACTS            -0x02010000
204 /* Tizen Phonenumber utils Error */
205 #define TIZEN_ERROR_PHONENUMBER_UTILS           -0x02020000
206 /* Tizen Storage Error */
207 #define TIZEN_ERROR_STORAGE             -0x02200000
208 /* Tizen Vconf Error */
209 #define TIZEN_ERROR_VCONF               -0x02210000
210 /* Tizen Device Error */
211 #define TIZEN_ERROR_DEVICE              -0x02400000
212 /* Tizen Dlog Error */
213 #define TIZEN_ERROR_DLOG                -0x02410000
214 /* Tizen Media Key Error */
215 #define TIZEN_ERROR_MEDIA_KEY           -0x02420000
216 /* Tizen Runtime Info Error */
217 #define TIZEN_ERROR_RUNTIME_INFORMATION -0x02430000
218 /* Tizen Sensor Error */
219 #define TIZEN_ERROR_SENSOR              -0x02440000
220 /* Tizen System Info Error */
221 #define TIZEN_ERROR_SYSTEM_INFORMATION  -0x02450000
222 /* Tizen System Setting Error */
223 #define TIZEN_ERROR_SYSTEM_SETTING      -0x02460000
224 /* Tizen System Resource Error */
225 #define TIZEN_ERROR_SYSTEM_RESOURCE     -0x02470000
226 /* Tizen Context Error */
227 #define TIZEN_ERROR_CONTEXT             -0x02480000
228 /* Tizen Health Error */
229 #define TIZEN_ERROR_HEALTH              -0x02490000
230 /* Tizen Feedback Error */
231 #define TIZEN_ERROR_FEEDBACK            -0x024A0000
232 /* Tizen USB Host Error */
233 #define TIZEN_ERROR_USB_HOST            -0x024B0000
234 /* Tizen Telephony Error */
235 #define TIZEN_ERROR_TELEPHONY           -0x02600000
236 /* Tizen EFL Util Error */
237 #define TIZEN_ERROR_EFL_UTIL            -0x02800000
238 /* Tizen UtilX Error */
239 #define TIZEN_ERROR_UTILX               -0x02810000
240 /* Tizen Native Buffer Error */
241 #define TIZEN_ERROR_NATIVE_BUFFER       -0x02820000
242 /* Tizen Buffer Manager Error */
243 #define TIZEN_ERROR_TBM                 -0x02830000
244 /* Tizen EOM Error */
245 #define TIZEN_ERROR_EOM                 -0x02840000
246 /* Tizen PANEL Error */
247 #define TIZEN_ERROR_PANEL               -0x02850000
248 /* Tizen TZSH Error */
249 #define TIZEN_ERROR_TZSH                -0x02860000
250 /* Tizen Download Error */
251 #define TIZEN_ERROR_DOWNLOAD    -0x02A00000
252 /* Tizen WebView Error */
253 #define TIZEN_ERROR_WEBVIEW             -0x02A10000
254 /* Tizen Location Manager Error */
255 #define TIZEN_ERROR_LOCATION_MANAGER    -0x02C00000
256 /* Tizen Geofence Manager Error */
257 #define TIZEN_ERROR_GEOFENCE_MANAGER    -0x02C10000
258 /* Tizen Maps Service Error */
259 #define TIZEN_ERROR_MAPS_SERVICE                -0x02C20000
260 /* Tizen STT Error */
261 #define TIZEN_ERROR_STT                 -0x02F00000
262 /* Tizen TTS Error */
263 #define TIZEN_ERROR_TTS                 -0x02F10000
264 /* Tizen IME Error */
265 #define TIZEN_ERROR_IME                 -0x02F20000
266 /* Tizen Service Adaptor Error */
267 #define TIZEN_ERROR_SERVICE_ADAPTOR     -0x02F30000
268 /* Tizen Widget Error */
269 #define TIZEN_ERROR_WIDGET              -0x02F40000
270 /* Tizen Voice Control Error */
271 #define TIZEN_ERROR_VOICE_CONTROL       -0x02F50000
272 /* Tizen Application Service Platform (ASP) Error */
273 #define TIZEN_ERROR_ASP                 -0x02F60000
274 /* Tizen Zigbee Error */
275 #define TIZEN_ZIGBEE_ERROR              -0x02F70000
276 /* Tizen Smart Traffic Control (STC) Error */
277 #define TIZEN_ERROR_STC                 -0x02F80000
278 /* Tizen Thumbnail Util Error */
279 #define TIZEN_ERROR_THUMBNAIL_UTIL      -0x02F90000
280 /* Tizen Job Scheduler Error */
281 #define TIZEN_ERROR_JOB_SCHEDULER       -0x02FA0000
282 /* Tizen SoftAP Error */
283 #define TIZEN_ERROR_SOFTAP              -0x02FB0000
284
285 /**
286  * @brief Enumeration for tizen errors.
287  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
288  *
289 */
290 typedef enum {
291         TIZEN_ERROR_NONE = 0, /**< Successful */
292         TIZEN_ERROR_NOT_PERMITTED = -EPERM, /**< Operation not permitted */
293         TIZEN_ERROR_NO_SUCH_FILE = -ENOENT, /**< No such file or directory */
294         TIZEN_ERROR_NO_SUCH_PROCESS = -ESRCH, /**< No such process */
295         TIZEN_ERROR_INTERRUPTED_SYS_CALL = -EINTR, /**< Interrupted system call */
296         TIZEN_ERROR_IO_ERROR = -EIO, /**< I/O error */
297         TIZEN_ERROR_NO_SUCH_DEVICE = -ENXIO, /**< No such device or address */
298         TIZEN_ERROR_ARGUMENT_LIST_TOO_LONG = -E2BIG, /**< Argument list too long */
299         TIZEN_ERROR_EXEC_FORMAT_ERROR = -ENOEXEC, /**< Exec format error */
300         TIZEN_ERROR_BAD_FILE_NUMBER = -EBADF, /**< Bad file number */
301         TIZEN_ERROR_TRY_AGAIN = -EAGAIN, /**< Try again */
302         TIZEN_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of memory */
303         TIZEN_ERROR_PERMISSION_DENIED = -EACCES, /**< Permission denied */
304         TIZEN_ERROR_BAD_ADDRESS = -EFAULT, /**< Bad address */
305         TIZEN_ERROR_BLOCK_DEVICE_REQUIRED = -ENOTBLK, /**< Block device required */
306         TIZEN_ERROR_RESOURCE_BUSY = -EBUSY, /**< Device or resource busy */
307         TIZEN_ERROR_FILE_EXISTS = -EEXIST, /**< File exists */
308         TIZEN_ERROR_CROSS_DEVICE_LINK = -EXDEV, /**< Cross-device link */
309         TIZEN_ERROR_NOT_A_DIRECTORY = -ENOTDIR, /**< Not a directory */
310         TIZEN_ERROR_IS_A_DIRECTORY = -EISDIR, /**< Is a directory */
311         TIZEN_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid function parameter */
312         TIZEN_ERROR_FILE_TABLE_OVERFLOW = -ENFILE, /**< File table overflow */
313         TIZEN_ERROR_TOO_MANY_OPEN_FILES = -EMFILE, /**< Too many open files */
314         TIZEN_ERROR_TOO_NOT_A_TERMINAL = -ENOTTY, /**< Not a terminal */
315         TIZEN_ERROR_TOO_TEXT_FILE_BUSY = -ETXTBSY, /**< Not a terminal */
316         TIZEN_ERROR_FILE_TOO_LARGE = -EFBIG, /**< File too large */
317         TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE = -ENOSPC, /**< No space left on device */
318         TIZEN_ERROR_ILLEGAL_SEEK = -ESPIPE, /**< Illegal seek */
319         TIZEN_ERROR_READ_ONLY_FILESYSTEM = -EROFS, /**< Read-only file system */
320         TIZEN_ERROR_NO_DATA = -ENODATA, /**< No data available */
321         TIZEN_ERROR_TOO_MANY_LINKS = -EMLINK, /**< Too many links */
322         TIZEN_ERROR_BROKEN_PIPE = -EPIPE, /**< Broken pipe */
323         TIZEN_ERROR_ARGUMENT_OUT_OF_DOMAIN = -EDOM, /**< Math argument out of domain of func */
324         TIZEN_ERROR_RESULT_OUT_OF_RANGE = -ERANGE, /**< Math result not representable */
325         TIZEN_ERROR_WOULD_CAUSE_DEADLOCK = -EDEADLK, /**< Resource deadlock would occur */
326         TIZEN_ERROR_FILE_NAME_TOO_LONG = -ENAMETOOLONG, /**< File name too long */
327         TIZEN_ERROR_FILE_NO_LOCKS_AVAILABLE = -ENOLCK, /**< No record locks available */
328         TIZEN_ERROR_INVALID_OPERATION = -ENOSYS, /**< Function not implemented */
329         TIZEN_ERROR_DIR_NOT_EMPTY = -ENOTEMPTY, /**< Directory not empty */
330         TIZEN_ERROR_TOO_MANY_SYMBOLIC_LINKS = -ELOOP, /**< Too many symbolic links encountered */
331         TIZEN_ERROR_WOULD_BLOCK = TIZEN_ERROR_TRY_AGAIN, /**< Operation would block */
332         TIZEN_ERROR_CORRUPTED_SHARED_LIB = -ELIBBAD, /**< Accessing a corrupted shared library */
333         TIZEN_ERROR_LIB_SECTION_CORRUPTED = -ELIBSCN, /**< .lib section in a.out corrupted */
334         TIZEN_ERROR_LINK_TOO_MANY_SHARED_LIB = -ELIBMAX, /**< Attempting to link in too many shared libraries */
335         TIZEN_ERROR_SHARED_LIB_EXEC = -ELIBEXEC, /**< Cannot exec a shared library directly */
336         TIZEN_ERROR_ILLEGAL_BYTE_SEQ = -EILSEQ, /**< Illegal byte sequence */
337         TIZEN_ERROR_SYSTEM_CALL_RESTART = -ERESTART, /**< Interrupted system call should be restarted */
338         TIZEN_ERROR_STREAMS_PIPE = -ESTRPIPE, /**< Streams pipe error */
339         TIZEN_ERROR_TOO_MANY_USERS = -EUSERS, /**< Too many users */
340         TIZEN_ERROR_NON_SOCKET = -ENOTSOCK, /**< Socket operation on non-socket */
341         TIZEN_ERROR_NO_DEST_ADDRESS = -EDESTADDRREQ, /**< Destination address required */
342         TIZEN_ERROR_MSG_TOO_LONG = -EMSGSIZE, /**< Message too long */
343         TIZEN_ERROR_PROTOCOL_WRONG_TYPE = -EPROTOTYPE, /**< Protocol wrong type for socket */
344         TIZEN_ERROR_PROTOCOL_NOT_AVALIABLE = -ENOPROTOOPT, /**< Protocol not available */
345         TIZEN_ERROR_PROTOCOL_NOT_SUPPORTED = -EPROTONOSUPPORT, /**< Protocol not supported */
346         TIZEN_ERROR_SOCKET_TYPE_NOT_SUPPORTED = -ESOCKTNOSUPPORT, /**< Socket type not supported */
347         TIZEN_ERROR_ENDPOINT_OPERATIN_NOT_SUPPORTED = -EOPNOTSUPP, /**< Operation not supported on transport endpoint */
348         TIZEN_ERROR_PROTOCOL_FAMILY_NOT_SUPPORTED = -EPFNOSUPPORT, /**< Protocol family not supported */
349         TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = -EAFNOSUPPORT, /**< Address family not supported by protocol */
350         TIZEN_ERROR_ADDRES_IN_USE = -EADDRINUSE, /**< Address already in use */
351         TIZEN_ERROR_CANNOT_ASSIGN_ADDRESS = -EADDRNOTAVAIL, /**< Cannot assign requested address */
352         TIZEN_ERROR_NETWORK_DOWN = -ENETDOWN, /**< Network is down */
353         TIZEN_ERROR_NETWORK_UNREACHABLE = -ENETUNREACH, /**< Network is unreachable */
354         TIZEN_ERROR_NETWORK_RESET = -ENETRESET, /**< Network dropped connection because of reset */
355         TIZEN_ERROR_CONNECTION_ABORTED = -ECONNABORTED, /**< Software caused connection abort */
356         TIZEN_ERROR_CONNECTION_RESET_BY_PEER = -ECONNRESET, /**< Connection reset by peer */
357         TIZEN_ERROR_BUFFER_SPACE = -ENOBUFS, /**< No buffer space available */
358         TIZEN_ERROR_ENDPOINT_CONNECTED = -EISCONN, /**< Transport endpoint is already connected */
359         TIZEN_ERROR_ENDPOINT_NOT_CONNECTED = -ENOTCONN, /**< Transport endpoint is not connected */
360         TIZEN_ERROR_ENDPOINT_SHUTDOWN = -ESHUTDOWN, /**< Cannot send after transport endpoint shutdown */
361         TIZEN_ERROR_TOO_MANY_REFERENCES = -ETOOMANYREFS, /**< Too many references: cannot splice */
362         TIZEN_ERROR_CONNECTION_TIME_OUT = -ETIMEDOUT, /**< Connection timed out */
363         TIZEN_ERROR_CONNECTION_REFUSED = -ECONNREFUSED, /**< Connection refused */
364         TIZEN_ERROR_HOST_DOWN = -EHOSTDOWN, /**< Host is down */
365         TIZEN_ERROR_NO_ROUTE_TO_HOST = -EHOSTUNREACH, /**< No route to host */
366         TIZEN_ERROR_ALREADY_IN_PROGRESS = -EALREADY, /**< Operation already in progress */
367         TIZEN_ERROR_NOW_IN_PROGRESS = -EINPROGRESS, /**< Operation now in progress */
368         TIZEN_ERROR_STALE_NFS_FILE_HANDLE = -ESTALE, /**< Stale NFS file handle */
369         TIZEN_ERROR_STRUCTURE_UNCLEAN = -EUCLEAN, /**< Structure needs cleaning */
370         TIZEN_ERROR_NOT_XENIX_NAMED_TYPE_FILE = -ENOTNAM, /**< Not a XENIX named type file */
371         TIZEN_ERROR_NO_XENIX_SEMAPHORES_AVAILABLE = -ENAVAIL, /**< No XENIX semaphores available */
372         TIZEN_ERROR_IS_NAMED_TYPE_FILE = -EISNAM, /**< Is a named type file */
373         TIZEN_ERROR_REMOTE_IO = -EREMOTEIO, /**< Remote I/O error */
374         TIZEN_ERROR_QUOTA_EXCEEDED = -EDQUOT, /**< Quota exceeded */
375         TIZEN_ERROR_NO_MEDIUM = -ENOMEDIUM, /**< No medium found */
376         TIZEN_ERROR_WRONG_MEDIUM_TYPE = -EMEDIUMTYPE, /**< Wrong medium type */
377         TIZEN_ERROR_CANCELED = -ECANCELED, /**< Operation Canceled */
378         TIZEN_ERROR_KEY_NOT_AVAILABLE = -ENOKEY, /**< Required key not available */
379         TIZEN_ERROR_KEY_EXPIRED = -EKEYEXPIRED, /**< Key has expired */
380         TIZEN_ERROR_KEY_REVOKED = -EKEYREVOKED, /**< Key has been revoked */
381         TIZEN_ERROR_KEY_REJECTED = -EKEYREJECTED, /**< Key was rejected by service */
382         TIZEN_ERROR_OWNER_DEAD = -EOWNERDEAD, /**< Owner died (for robust mutexes) */
383         TIZEN_ERROR_UNKNOWN = TIZEN_ERROR_MIN_PLATFORM_ERROR, /**< Unknown error */
384         /* This is a place to add new errors here.
385          * Do not assign integer values explicitly. Values are auto-assigned.
386          */
387         TIZEN_ERROR_TIMED_OUT, /**< Time out */
388         TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
389         TIZEN_ERROR_USER_NOT_CONSENTED, /**< Not Consented */
390         TIZEN_ERROR_DEVICE_POLICY_RESTRICTION, /**< Restriction by Device Policy */
391         TIZEN_ERROR_END_OF_COLLECTION,
392         } tizen_error_e;
393
394
395 /**
396  * @brief Gets the last error code in the thread.
397  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
398  * @details This function retrieves the last error code which is set by set_last_result()
399  * @return One of #tizen_error_e
400  * @see #tizen_error_e
401  * @see set_last_result()
402 */
403 int get_last_result(void);
404
405
406 /**
407  * @brief Sets the last error code to be returned in the thread.
408  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
409  * @param[in] err The error code to be returned
410  * @see #tizen_error_e
411  * @see get_last_result()
412 */
413 void set_last_result(int err);
414
415
416 /**
417  * @brief Gets the message for given the error code.
418  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
419  * @remark This function returns a static pointer; subsequent calls will overwrite it.
420  * @param[in] err The error value to be returned
421  * @return The error's message
422  * @see #tizen_error_e
423  *
424  * @code
425  *  char* errMsg;
426  *  location_manager_h location_handle;
427  *  int result = location_manager_create(LOCATION_METHOD_GPS, &location_handle);
428  *
429  *  if (LOCATIONS_ERROR_NONE != result) {
430  *      errMsg = get_error_message(result);
431  *      dlog_print(DLOG_INFO, "MyTag", "%s", errMsg);
432  *  }
433  * @endcode
434  *
435  */
436 char *get_error_message(int err);
437
438
439 /**
440  * @}
441  */
442
443
444 #ifdef __cplusplus
445 }
446
447
448 #endif
449 #endif             /**<__TIZEN_COMMON_ERROR_H__ */