From eb9d71f344e5222977a48101192494e19e806bdd Mon Sep 17 00:00:00 2001 From: Sunggyu Choi Date: Wed, 20 May 2015 17:14:00 +0900 Subject: [PATCH] Add new tizen errors for newly added features and modules Change-Id: Ia2e7c20fdf3a21f74360846d667196a9c1de79ce Signed-off-by: Sunggyu Choi --- include/tizen_error.h | 42 ++++++++++--- packaging/capi-base-common.spec | 2 +- src/tizen_error.c | 127 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 153 insertions(+), 18 deletions(-) diff --git a/include/tizen_error.h b/include/tizen_error.h index dd98dd9..a226ec7 100755 --- a/include/tizen_error.h +++ b/include/tizen_error.h @@ -84,6 +84,10 @@ extern "C" { /* Tizen Account Error */ #define TIZEN_ERROR_ACCOUNT -0x01000000 +/* Tizen Account Oauth Error */ +#define TIZEN_ERROR_ACCOUNT_OAUTH -0x01010000 +/* Tizen SYNC MANAGER Error */ +#define TIZEN_ERROR_SYNC_MANAGER -0x01020000 /* Tizen Application Error */ #define TIZEN_ERROR_APPLICATION -0x01100000 /* Tizen Application Manager Error */ @@ -106,6 +110,8 @@ extern "C" { #define TIZEN_ERROR_DATA_CONTROL -0x01190000 /* Tizen Service Application Error */ #define TIZEN_ERROR_SERVICE_APPLICATION -0x01200000 +/* Tizen MINICONTROL Error */ +#define TIZEN_ERROR_MINICONTROL -0x01210000 /* Tizen Utility ICU Error */ #define TIZEN_ERROR_UTILITY_ICU -0x01500000 /* Tizen Mime Type Error */ @@ -141,7 +147,9 @@ extern "C" { /* Tizen Radio Error */ #define TIZEN_ERROR_RADIO -0x019A0000 /* Tizen MEDIA CODEC Error */ -#define TIZEN_ERROR_MEDIACODEC -0x019B0000 +#define TIZEN_ERROR_MEDIACODEC -0x019B0000 +/* Tizen Metadata Editor Error */ +#define TIZEN_ERROR_METADATA_EDITOR -0x019C0000 /* Tizen Bluetooth Error */ #define TIZEN_ERROR_BLUETOOTH -0x01C00000 /* Tizen Connection Error */ @@ -156,6 +164,8 @@ extern "C" { #define TIZEN_ERROR_WIFI -0x01C50000 /* Tizen Wifi Direct Error */ #define TIZEN_ERROR_WIFI_DIRECT -0x01C60000 +/* Tizen Smart Card Error */ +#define TIZEN_ERROR_SMARTCARD -0x01C70000 /* Tizen Privacy Manager Error */ #define TIZEN_ERROR_PRIVACY_MANAGER -0x01E00000 /* Tizen Key Manager Error */ @@ -188,6 +198,10 @@ extern "C" { #define TIZEN_ERROR_SYSTEM_RESOURCE -0x02470000 /* Tizen Context Error */ #define TIZEN_ERROR_CONTEXT -0x02480000 +/* Tizen Health Error */ +#define TIZEN_ERROR_HEALTH -0x02490000 +/* Tizen Feedback Error */ +#define TIZEN_ERROR_FEEDBACK -0x024A0000 /* Tizen Telephony Error */ #define TIZEN_ERROR_TELEPHONY -0x02600000 /* Tizen EFL Util Error */ @@ -198,23 +212,35 @@ extern "C" { #define TIZEN_ERROR_NATIVE_BUFFER -0x02820000 /* Tizen Buffer Manager Error */ #define TIZEN_ERROR_TBM -0x02830000 +/* Tizen EOM Error */ +#define TIZEN_ERROR_EOM -0x02840000 /* Tizen Download Error */ #define TIZEN_ERROR_DOWNLOAD -0x02A00000 /* Tizen WebView Error */ #define TIZEN_ERROR_WEBVIEW -0x02A10000 -/* Tizen Location Manager */ +/* Tizen Location Manager Error */ #define TIZEN_ERROR_LOCATION_MANAGER -0x02C00000 +/* Tizen Geofence Manager Error */ +#define TIZEN_ERROR_GEOFENCE_MANAGER -0x02C10000 +/* Tizen Maps Service Error */ +#define TIZEN_ERROR_MAPS_SERVICE -0x02C20000 /* Tizen STT Error */ #define TIZEN_ERROR_STT -0x02F00000 /* Tizen TTS Error */ #define TIZEN_ERROR_TTS -0x02F10000 - - +/* Tizen IME Error */ +#define TIZEN_ERROR_IME -0x02F20000 +/* Tizen Service Adaptor Error */ +#define TIZEN_ERROR_SERVICE_ADAPTOR -0x02F30000 +/* Tizen Widget Error */ +#define TIZEN_ERROR_WIDGET -0x02F40000 +/* Tizen Voice Control Error */ +#define TIZEN_ERROR_VOICE_CONTROL -0x02F50000 /** * @brief Enumeration for tizen errors. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * */ typedef enum @@ -331,7 +357,7 @@ typedef enum /** * @brief Gets the last error code in the thread. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @details This function retrieves the last error code which is set by set_last_result() * @@ -344,7 +370,7 @@ int get_last_result(void); /** * @brief Sets the last error code to be returned in the thread. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] err The error code to be returned * @@ -355,7 +381,7 @@ void set_last_result(int err); /** * @brief Gets the message for given the error code. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @remark This function returns a static pointer; subsequent calls will overwrite it. * @param[in] err The error value to be returned diff --git a/packaging/capi-base-common.spec b/packaging/capi-base-common.spec index bd2b9f3..463cb47 100644 --- a/packaging/capi-base-common.spec +++ b/packaging/capi-base-common.spec @@ -1,6 +1,6 @@ Name: capi-base-common Summary: Common header files of Tizen Native API -Version: 0.1.6 +Version: 0.1.9 Release: 0 Group: System/API License: Apache-2.0 diff --git a/src/tizen_error.c b/src/tizen_error.c index def056c..9d830f7 100755 --- a/src/tizen_error.c +++ b/src/tizen_error.c @@ -2,6 +2,9 @@ #include #include "tizen.h" +/* END of Tizen Platoform Error */ +#define TIZEN_ERROR_MIN_PLATFORM_MODULE -0x0FFFFFFF + #define ERR_ENTRY(name, value, msg) {value, name, msg} typedef struct tizen_err_info @@ -190,20 +193,24 @@ static err_info err_list[] = #if defined (TIZEN_ERROR_RADIO) ERR_ENTRY("RADIO_ERROR_INVALID_STATE", TIZEN_ERROR_RADIO | 0x01 ,"Invalid state"), ERR_ENTRY("RADIO_ERROR_SOUND_POLICY", TIZEN_ERROR_RADIO | 0x02 ,"Sound policy error"), + ERR_ENTRY("RADIO_ERROR_NO_ANTENNA", TIZEN_ERROR_RADIO | 0x03 ,"No Antenna error"), + #endif #if defined (TIZEN_ERROR_MEDIACODEC) ERR_ENTRY("MEDIACODEC_ERROR_INVALID_STATE", TIZEN_ERROR_MEDIACODEC | 0x01 ,"Invalid state"), ERR_ENTRY("MEDIACODEC_ERROR_INVALID_INBUFFER", TIZEN_ERROR_MEDIACODEC | 0x02 ,"Invalid input buffer"), - ERR_ENTRY("MEDIACODEC_ERROR_INVALID_OUTBUFFER", TIZEN_ERROR_MEDIACODEC | 0x03 ,"Invalid state"), + ERR_ENTRY("MEDIACODEC_ERROR_INVALID_OUTBUFFER", TIZEN_ERROR_MEDIACODEC | 0x03 ,"Invalid output buffer"), ERR_ENTRY("MEDIACODEC_ERROR_INTERNAL", TIZEN_ERROR_MEDIACODEC | 0x04 ,"Invalid output buffer"), ERR_ENTRY("MEDIACODEC_ERROR_NOT_INITIALIZED", TIZEN_ERROR_MEDIACODEC | 0x05 ,"Internal error"), ERR_ENTRY("MEDIACODEC_ERROR_INVALID_STREAM", TIZEN_ERROR_MEDIACODEC | 0x06 ,"Not initialized mediacodec"), - ERR_ENTRY("MEDIACODEC_ERROR_CODEC_NOT_FOUND", TIZEN_ERROR_MEDIACODEC | 0x07 ,"Not supported format"), + ERR_ENTRY("MEDIACODEC_ERROR_CODEC_NOT_FOUND", TIZEN_ERROR_MEDIACODEC | 0x07 ,"Cannot find codec"), ERR_ENTRY("MEDIACODEC_ERROR_DECODE", TIZEN_ERROR_MEDIACODEC | 0x08 ,"Error while decoding data"), ERR_ENTRY("MEDIACODEC_ERROR_NO_FREE_SPACE", TIZEN_ERROR_MEDIACODEC | 0x09 ,"Out of storage"), ERR_ENTRY("MEDIACODEC_ERROR_STREAM_NOT_FOUND", TIZEN_ERROR_MEDIACODEC | 0x0a ,"Cannot find stream"), ERR_ENTRY("MEDIACODEC_ERROR_NOT_SUPPORTED_FORMAT", TIZEN_ERROR_MEDIACODEC | 0x0b ,"Not supported format "), ERR_ENTRY("MEDIACODEC_ERROR_BUFFER_NOT_AVAILABLE", TIZEN_ERROR_MEDIACODEC | 0x0c ,"Not available buffer"), + ERR_ENTRY("MEDIACODEC_ERROR_OVERFLOW_INBUFFER", TIZEN_ERROR_MEDIACODEC | 0x0d ,"Overflow input buffer"), + ERR_ENTRY("MEDIACODEC_ERROR_RESOURCE_OVERLOADED", TIZEN_ERROR_MEDIACODEC | 0x0e ,"Exceed the instance limt"), #endif #if defined (TIZEN_ERROR_BLUETOOTH) ERR_ENTRY("BT_ERROR_NOT_ENABLED", TIZEN_ERROR_BLUETOOTH | 0x0102 ,"Local adapter not enabled"), @@ -245,6 +252,7 @@ static err_info err_list[] = ERR_ENTRY("NFC_ERROR_ILLEGAL_STATE",TIZEN_ERROR_NFC|0x0d ,"The state is wrong"), ERR_ENTRY("NFC_ERROR_NOT_INITIALIZED",TIZEN_ERROR_NFC|0x0e ,"NFC is not initialized"), ERR_ENTRY("NFC_ERROR_TAG_NOT_SUPPORTED",TIZEN_ERROR_NFC|0x0f ,"Tag is not supported"), + ERR_ENTRY("NFC_ERROR_AID_ALREADY_REGISTERED",TIZEN_ERROR_NFC | 0x10 ,"AID already registered"), #endif #if defined (TIZEN_ERROR_SERIAL) #endif @@ -266,7 +274,7 @@ static err_info err_list[] = ERR_ENTRY("WIFI_DIRECT_ERROR_NOT_INITIALIZED",TIZEN_ERROR_WIFI_DIRECT | 0x01 ,"Not initialized"), ERR_ENTRY("WIFI_DIRECT_ERROR_COMMUNICATION_FAILED",TIZEN_ERROR_WIFI_DIRECT | 0x02 ,"I/O error"), ERR_ENTRY("WIFI_DIRECT_ERROR_WIFI_USED",TIZEN_ERROR_WIFI_DIRECT | 0x03 ,"WiFi is being used"), - ERR_ENTRY("WIFI_DIRECT_ERROR_MOBILE_AP_USED",TIZEN_ERROR_WIFI_DIRECT | 0x04 ,"Operation failed"), + ERR_ENTRY("WIFI_DIRECT_ERROR_MOBILE_AP_USED",TIZEN_ERROR_WIFI_DIRECT | 0x04 ,"Mobile AP is being used"), ERR_ENTRY("WIFI_DIRECT_ERROR_CONNECTION_FAILED",TIZEN_ERROR_WIFI_DIRECT | 0x05 ,"Mobile AP is being used"), ERR_ENTRY("WIFI_DIRECT_ERROR_AUTH_FAILED",TIZEN_ERROR_WIFI_DIRECT | 0x06 ,"Authentication failed"), ERR_ENTRY("WIFI_DIRECT_ERROR_OPERATION_FAILED",TIZEN_ERROR_WIFI_DIRECT | 0x07 ,"Operation failed"), @@ -293,6 +301,7 @@ static err_info err_list[] = ERR_ENTRY("CKMC_ERROR_INVALID_FORMAT",TIZEN_ERROR_KEY_MANAGER | 0x0E ,"A provided file doesn't exists or cannot be accessed in the file system"), ERR_ENTRY("CKMC_ERROR_FILE_ACCESS_DENIED",TIZEN_ERROR_KEY_MANAGER | 0x0F ,"A provided file or binary has not a valid format"), ERR_ENTRY("CKMC_ERROR_NOT_EXPORTABLE",TIZEN_ERROR_KEY_MANAGER | 0x10 ,"Key is not exportable. It could not be returned to client"), + ERR_ENTRY("CKMC_ERROR_FILE_SYSTEM",TIZEN_ERROR_KEY_MANAGER | 0x11 ,"Save key\/certificate\/pkcs12 failed because of file system error"), ERR_ENTRY("CKMC_ERROR_UNKNOWN",TIZEN_ERROR_KEY_MANAGER | 0xFF ,"The error with unknown reason"), #endif #if defined (TIZEN_ERROR_PRIVILEGE_INFORMATION) @@ -348,7 +357,9 @@ static err_info err_list[] = ERR_ENTRY("TELEPHONY_ERROR_SIM_NOT_AVAILABLE",TIZEN_ERROR_TELEPHONY | 0x1001 ,"SIM is not available"), #endif #if defined (TIZEN_ERROR_EFL_UTIL) - ERR_ENTRY("EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE",TIZEN_ERROR_EFL_UTIL | 0x1001 ,"Window type not supported"), + ERR_ENTRY("EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE",TIZEN_ERROR_EFL_UTIL | 0x01 ,"Window type not supported"), + ERR_ENTRY("EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL",TIZEN_ERROR_EFL_UTIL | 0x02 ,"Screenshot initialization fail"), + ERR_ENTRY("EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL",TIZEN_ERROR_EFL_UTIL | 0x03 ,"Screenshot execution fail"), #endif #if defined (TIZEN_ERROR_UTILX) #endif @@ -398,6 +409,102 @@ static err_info err_list[] = ERR_ENTRY("TTS_ERROR_OPERATION_FAILED",TIZEN_ERROR_TTS | 0x04 ,"Operation failed"), ERR_ENTRY("TTS_ERROR_AUDIO_POLICY_BLOCKED",TIZEN_ERROR_TTS | 0x05 ,"Audio policy blocked"), #endif +#if defined (TIZEN_ERROR_SMARTCARD) + ERR_ENTRY("SMARTCARD_ERROR_GENERAL",TIZEN_ERROR_SMARTCARD | 0x01 ,"A general error occurred"), + ERR_ENTRY("SMARTCARD_ERROR_NO_SUCH_ELEMENT",TIZEN_ERROR_SMARTCARD | 0x02 ,"No such element error"), + ERR_ENTRY("SMARTCARD_ERROR_ILLEGAL_STATE",TIZEN_ERROR_SMARTCARD | 0x03 ,"Illegal state of execution error"), + ERR_ENTRY("SMARTCARD_ERROR_ILLEGAL_REFERENCE",TIZEN_ERROR_SMARTCARD | 0x04 ,"Illegal reference"), + ERR_ENTRY("SMARTCARD_ERROR_OPERATION_NOT_SUPPORTED",TIZEN_ERROR_SMARTCARD | 0x05 ,"Operation not supported from SE"), + ERR_ENTRY("SMARTCARD_ERROR_CHANNEL_NOT_AVAILABLE",TIZEN_ERROR_SMARTCARD | 0x06 ,"No channel available"), + ERR_ENTRY("SMARTCARD_ERROR_NOT_INITIALIZED",TIZEN_ERROR_SMARTCARD | 0x07 ,"Smartcard service not initialized"), +#endif +#if defined (TIZEN_ERROR_HEALTH) + ERR_ENTRY("HEALTH_ERROR_DATA_TYPE_NOT_FOUND",TIZEN_ERROR_HEALTH | 0x01 ,"Maifest for the data type specified not found"), + ERR_ENTRY("HEALTH_ERROR_MANDATORY_DATA_REQURIED",TIZEN_ERROR_HEALTH | 0x02 ,"Mandatory property is missing"), + ERR_ENTRY("HEALTH_ERROR_INVALID_DATA",TIZEN_ERROR_HEALTH | 0x03 ,"Data is out of range or invalid type"), +#endif +#if defined (TIZEN_ERROR_VOICE_CONTROL) + ERR_ENTRY("VC_ERROR_INVALID_STATE",TIZEN_ERROR_VOICE_CONTROL | 0x011 ,"Invalid state"), + ERR_ENTRY("VC_ERROR_INVALID_LANGUAGE",TIZEN_ERROR_VOICE_CONTROL | 0x012 ,"Invalid language"), + ERR_ENTRY("VC_ERROR_ENGINE_NOT_FOUND",TIZEN_ERROR_VOICE_CONTROL | 0x013 ,"No available engine"), + ERR_ENTRY("VC_ERROR_OPERATION_FAILED",TIZEN_ERROR_VOICE_CONTROL | 0x014 ,"Operation failed"), + ERR_ENTRY("VC_ERROR_OPERATION_REJECTED",TIZEN_ERROR_VOICE_CONTROL | 0x015 ,"Operation rejected"), + ERR_ENTRY("VC_ERROR_ITERATION_END",TIZEN_ERROR_VOICE_CONTROL | 0x016 ,"List reached end"), + ERR_ENTRY("VC_ERROR_EMPTY",TIZEN_ERROR_VOICE_CONTROL | 0x017 ,"List empty"), + //voice ui control + ERR_ENTRY("VC_ELM_ERROR_INVALID_STATE",TIZEN_ERROR_VOICE_CONTROL | 0x021 ," Invalid state"), + ERR_ENTRY("VC_ELM_ERROR_INVALID_LANGUAG",TIZEN_ERROR_VOICE_CONTROL | 0x022 ,"Invalid language"), + ERR_ENTRY("VC_ELM_ERROR_OPERATION_FAILED",TIZEN_ERROR_VOICE_CONTROL | 0x023 ,"Operation failed"), + ERR_ENTRY("VC_ELM_ERROR_OPERATION_REJECTED",TIZEN_ERROR_VOICE_CONTROL | 0x024 ,"Operation rejected"), +#endif +#if defined (TIZEN_ERROR_FEEDBACK) + ERR_ENTRY("FEEDBACK_ERROR_NOT_INITIALIZED",TIZEN_ERROR_FEEDBACK | 0x01 ,"Not initialized"), +#endif +#if defined (TIZEN_ERROR_EOM) + ERR_ENTRY("EOM_ERROR_INVALID_OUTPUT",TIZEN_ERROR_EOM | 0x01 ,"Invalid external output instance"), + ERR_ENTRY("EOM_ERROR_CONNECTION_FAILURE",TIZEN_ERROR_EOM | 0x02 ,"Connection failure"), + ERR_ENTRY("EOM_ERROR_MESSAGE_SENDING_FAILURE",TIZEN_ERROR_EOM | 0x03 ,"Message sending failure"), + ERR_ENTRY("EOM_ERROR_MESSAGE_OPERATION_FAILURE",TIZEN_ERROR_EOM | 0x04 ,"Message operation failure"), +#endif +#if defined (TIZEN_ERROR_WIDGET) + ERR_ENTRY("WIDGET_ERROR_FAULT",TIZEN_ERROR_WIDGET | 0x0001 ,"Fault - Unable to recover from the error"), + ERR_ENTRY("WIDGET_ERROR_ALREADY_EXIST",TIZEN_ERROR_WIDGET | 0x0002 ,"Already exists"), + ERR_ENTRY("WIDGET_ERROR_ALREADY_STARTED",TIZEN_ERROR_WIDGET | 0x0004 ,"Operation is already started"), + ERR_ENTRY("WIDGET_ERROR_NOT_EXIST",TIZEN_ERROR_WIDGET | 0x0008 ,"Not exists"), + ERR_ENTRY("WIDGET_ERROR_DISABLED",TIZEN_ERROR_WIDGET | 0x00010 ,"Disabled"), +#endif +#if defined (TIZEN_ERROR_MINICONTROL) + ERR_ENTRY("MINICONTROL_ERROR_IPC_FAILURE",TIZEN_ERROR_MINICONTROL | 0x02 ," IPC error"), + ERR_ENTRY("MINICONTROL_ERROR_ELM_FAILURE",TIZEN_ERROR_MINICONTROL | 0x03 ," Some error occued on elementary"), +#endif +#if defined (TIZEN_ERROR_IME) + ERR_ENTRY("IME_ERROR_NO_CALLBACK_FUNCTION",TIZEN_ERROR_IME | 0x0001 ,"Necessary callback function is not set"), + ERR_ENTRY("IME_ERROR_NOT_RUNNING",TIZEN_ERROR_IME | 0x0002 ,"IME main loop isn't started yet "), + ERR_ENTRY("IME_ERROR_OPERATION_FAILED",TIZEN_ERROR_IME | 0x0003 ,"Operation failed"), +ERR_ENTRY("IME_MANAGER_ERROR_OPERATION_FAILED",TIZEN_ERROR_IME | 0x0010 ,"Operation failed"), +#endif +#if defined (TIZEN_ERROR_MAPS_SERVICE) + ERR_ENTRY("MAPS_ERROR_SERVICE_NOT_AVAILABLE",TIZEN_ERROR_MAPS_SERVICE | 0x01 ,"Service unavailable"), + ERR_ENTRY("MAPS_ERROR_NOT_FOUND",TIZEN_ERROR_MAPS_SERVICE | 0x02 ,"Result not found "), +#endif +#if defined (TIZEN_ERROR_GEOFENCE_MANAGER) + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED",TIZEN_ERROR_GEOFENCE_MANAGER | 0x01 ,"Geofence Manager is not initialized"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_INVALID_ID",TIZEN_ERROR_GEOFENCE_MANAGER | 0x02 ,"Invalid Geofence ID"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_EXCEPTION",TIZEN_ERROR_GEOFENCE_MANAGER | 0x03 ,"exception is occurred"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_ALREADY_STARTED",TIZEN_ERROR_GEOFENCE_MANAGER | 0x04 ,"Geofence is already started"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_TOO_MANY_GEOFENCE",TIZEN_ERROR_GEOFENCE_MANAGER | 0x05 ,"Too many Geofence"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_IPC",TIZEN_ERROR_GEOFENCE_MANAGER | 0x06 ,"Error occurred in GPS/Wi-Fi/BT"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_DATABASE",TIZEN_ERROR_GEOFENCE_MANAGER | 0x07 ,"DB error occurred in the server side"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED",TIZEN_ERROR_GEOFENCE_MANAGER | 0x08 ,"Access to specified place is denied"), + ERR_ENTRY("GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED",TIZEN_ERROR_GEOFENCE_MANAGER | 0x09 ,"Access to specified geofence is denied"), +#endif +#if defined (TIZEN_ERROR_SYNC_MANAGER) + ERR_ENTRY("SYNC_ERROR_SYSTEM", TIZEN_ERROR_SYNC_MANAGER | 0x01 ,"System error"), +#endif +#if defined (TIZEN_ERROR_SERVICE_ADAPTOR) + ERR_ENTRY("SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE",TIZEN_ERROR_SERVICE_ADAPTOR | 0x01 ,"IPC Connection unstabled"), + ERR_ENTRY("SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED",TIZEN_ERROR_SERVICE_ADAPTOR | 0x02 ,"The error occured from Plugin"), + ERR_ENTRY("SERVICE_ADAPTOR_ERROR_NOT_AUTHOLIZED",TIZEN_ERROR_SERVICE_ADAPTOR | 0x03 ,"Need Autholization "), + ERR_ENTRY("SERVICE_ADAPTOR_ERROR_INVALID_STATE",TIZEN_ERROR_SERVICE_ADAPTOR | 0x04 ,"The handle state is invalid for processing API"), +#endif +#if defined (TIZEN_ERROR_ACCOUNT_OAUTH) + ERR_ENTRY("OAUTH2_ERROR_PARSE_FAILED",TIZEN_ERROR_ACCOUNT_OAUTH | 0x01 ,"Response parse failed"), + ERR_ENTRY("OAUTH2_ERROR_NETWORK_ERROR",TIZEN_ERROR_ACCOUNT_OAUTH | 0x02 ,"Network error"), + ERR_ENTRY("OAUTH2_ERROR_SERVER",TIZEN_ERROR_ACCOUNT_OAUTH | 0x03 ,"Server error"), + ERR_ENTRY("OAUTH2_ERROR_USER_CANCELLED",TIZEN_ERROR_ACCOUNT_OAUTH | 0x04 ,"User cancelled the operation"), + ERR_ENTRY("OAUTH2_ERROR_VALUE_NOT_FOUND",TIZEN_ERROR_ACCOUNT_OAUTH | 0x05 ,"Value not found"), +#endif +#if defined (TIZEN_ERROR_CONTEXT) + ERR_ENTRY("CONTEXT_HISTORY_ERROR_OUT_OF_RANGE",TIZEN_ERROR_CONTEXT | 0x03 ,"Out of range"), + ERR_ENTRY("CONTEXT_HISTORY_ERROR_OPERATION_FAILED",TIZEN_ERROR_CONTEXT | 0x04 ,"Operation failed"), +#endif +#if defined (TIZEN_ERROR_CONTEXT) + ERR_ENTRY("CONTEXT_TRIGGER_ERROR_OPERATION_FAILED",TIZEN_ERROR_CONTEXT | 0x04 ,"Operation failed"), + ERR_ENTRY("CONTEXT_TRIGGER_ERROR_RULE_ENABLED",TIZEN_ERROR_CONTEXT | 0x05 ,"Rule is enabled"), + ERR_ENTRY("CONTEXT_TRIGGER_ERROR_RULE_NOT_ENABLED",TIZEN_ERROR_CONTEXT | 0x06 ,"Rule is not enabled"), + ERR_ENTRY("CONTEXT_TRIGGER_ERROR_INVALID_RULE",TIZEN_ERROR_CONTEXT | 0x07 ,"Invalid rule"), + ERR_ENTRY("CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST",TIZEN_ERROR_CONTEXT | 0x08 ,"Rule does not exist"), +#endif {0,NULL,NULL} }; @@ -429,7 +536,6 @@ char* _get_error_message(int err_code) return msg; } - char* get_error_message(int err_code) { static __thread char msg[512]; @@ -438,10 +544,13 @@ char* get_error_message(int err_code) if( err_code >= TIZEN_ERROR_OWNER_DEAD && err_code < 0) { - tmp = strerror(~err_code + 1); - if(tmp != NULL) + if((~err_code+1) == -ENOSYS) { - strncpy(msg,tmp,strlen(tmp)); + strncpy(msg,"Invalid operation",strlen("Invalid operation")); + } + else + { + strerror_r(~err_code + 1, msg, sizeof(msg)); } } else if(err_code >= TIZEN_ERROR_MIN_PLATFORM_ERROR && err_code < TIZEN_ERROR_END_OF_COLLECTION) @@ -452,7 +561,7 @@ char* get_error_message(int err_code) strncpy(msg,tmp,strlen(tmp)); } } - else if(err_code >= TIZEN_ERROR_TTS && err_code < -0x009F0000) + else if(err_code >= TIZEN_ERROR_MIN_PLATFORM_MODULE && err_code < -0x009F0000) { tmp = _get_error_message(err_code); if(tmp != NULL) -- 2.7.4