Fix error handling 48/17848/2
authorLee Dongyeol <dy3.lee@samsung.com>
Thu, 4 Jul 2013 01:16:50 +0000 (10:16 +0900)
committerLee Dongyeol <dy3.lee@samsung.com>
Tue, 11 Mar 2014 11:05:02 +0000 (20:05 +0900)
Change-Id: Iee3060a9d71c5d070f619461538be7260d730ba2

server/ttsd_config.c
server/ttsd_config_noti.c
server/ttsd_config_sr.c
server/ttsd_server.c

index d79b3dc..fc55e30 100644 (file)
@@ -291,61 +291,16 @@ int ttsd_config_set_default_speed(int speed)
 int ttsd_config_save_error(int uid, int uttid, const char* lang, int vctype, const char* text, 
                           const char* func, int line, const char* message)
 {
-       FILE* err_fp;
-       err_fp = fopen(DEFAULT_ERROR_FILE_NAME, "a");
-       if (NULL == err_fp) {
-               SLOG(LOG_WARN, get_tag(), "[WARNING] Fail to open error file (%s)", DEFAULT_ERROR_FILE_NAME);
-               return -1;
-       }
-       SLOG(LOG_DEBUG, get_tag(), "Save Error File (%s)", DEFAULT_ERROR_FILE_NAME);
+       SLOG(LOG_ERROR, get_tag(), "=============== TTS ERROR LOG ====================");
 
-       /* func */
-       if (NULL != func) {
-               fprintf(err_fp, "function - %s\n", func);
-       }
+       SLOG(LOG_ERROR, get_tag(), "uid(%d) uttid(%d)", uid, uttid);
        
-       /* line */
-       fprintf(err_fp, "line - %d\n", line);
-
-       /* message */
-       if (NULL != message) {
-               fprintf(err_fp, "message - %s\n", message);
-       }
-
-       int ret;
-       /* uid */
-       fprintf(err_fp, "uid - %d\n", uid);
-       
-       /* uttid */
-       fprintf(err_fp, "uttid - %d\n", uttid);
-
-       /* lang */
-       if (NULL != lang) {
-               fprintf(err_fp, "language - %s\n", lang);
-       }
-
-       /* vctype */
-       fprintf(err_fp, "vctype - %d\n", vctype);
-
-       /* text */
-       if (NULL != text) {
-               fprintf(err_fp, "text - %s\n", text);
-       }
-
-       /* get current engine */
-       char *engine_id = NULL;
-
-       ret = ttsd_engine_setting_get_engine(&engine_id);
-       if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[ERROR] Fail to get current engine");
-       } else {
-               fprintf(err_fp, "current engine - %s", engine_id);
-       }
-
-       /* get data */
-       ttsd_data_save_error_log(uid, err_fp);
+       if (NULL != func)       SLOG(LOG_ERROR, get_tag(), "Function(%s) Line(%d)", func, line);
+       if (NULL != message)    SLOG(LOG_ERROR, get_tag(), "Message(%s)", message);
+       if (NULL != lang)       SLOG(LOG_ERROR, get_tag(), "Lang(%s), type(%d)", lang, vctype);
+       if (NULL != text)       SLOG(LOG_ERROR, get_tag(), "Text(%s)", text);
 
-       fclose(err_fp);
+       SLOG(LOG_ERROR, get_tag(), "==================================================");
 
        return 0;
 }
\ No newline at end of file
index d36bc44..5b593bb 100644 (file)
@@ -441,61 +441,16 @@ int ttsd_config_set_default_speed(int speed)
 int ttsd_config_save_error(int uid, int uttid, const char* lang, int vctype, const char* text, 
                           const char* func, int line, const char* message)
 {
-       FILE* err_fp;
-       err_fp = fopen(NOTI_ERROR_FILE_NAME, "a");
-       if (NULL == err_fp) {
-               SLOG(LOG_WARN, get_tag(), "[WARNING] Fail to open error file (%s)", NOTI_ERROR_FILE_NAME);
-               return -1;
-       }
-       SLOG(LOG_DEBUG, get_tag(), "Save Error File (%s)", NOTI_ERROR_FILE_NAME);
-
-       /* func */
-       if (NULL != func) {
-               fprintf(err_fp, "function - %s\n", func);
-       }
-       
-       /* line */
-       fprintf(err_fp, "line - %d\n", line);
-
-       /* message */
-       if (NULL != message) {
-               fprintf(err_fp, "message - %s\n", message);
-       }
-
-       int ret;
-       /* uid */
-       fprintf(err_fp, "uid - %d\n", uid);
-       
-       /* uttid */
-       fprintf(err_fp, "uttid - %d\n", uttid);
+       SLOG(LOG_ERROR, get_tag(), "=============== TTS ERROR LOG ====================");
 
-       /* lang */
-       if (NULL != lang) {
-               fprintf(err_fp, "language - %s\n", lang);
-       }
-
-       /* vctype */
-       fprintf(err_fp, "vctype - %d\n", vctype);
+       SLOG(LOG_ERROR, get_tag(), "uid(%d) uttid(%d)", uid, uttid);
 
-       /* text */
-       if (NULL != text) {
-               fprintf(err_fp, "text - %s\n", text);
-       }
+       if (NULL != func)       SLOG(LOG_ERROR, get_tag(), "Function(%s) Line(%d)", func, line);
+       if (NULL != message)    SLOG(LOG_ERROR, get_tag(), "Message(%s)", message);
+       if (NULL != lang)       SLOG(LOG_ERROR, get_tag(), "Lang(%s), type(%d)", lang, vctype);
+       if (NULL != text)       SLOG(LOG_ERROR, get_tag(), "Text(%s)", text);
 
-       /* get current engine */
-       char *engine_id = NULL;
-
-       ret = ttsd_engine_setting_get_engine(&engine_id);
-       if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[ERROR] Fail to get current engine");
-       } else {
-               fprintf(err_fp, "current engine - %s", engine_id);
-       }
-
-       /* get data */
-       ttsd_data_save_error_log(uid, err_fp);
-
-       fclose(err_fp);
+       SLOG(LOG_ERROR, get_tag(), "==================================================");
 
        return 0;
-}
\ No newline at end of file
+}
index 1364dcf..55e2f74 100644 (file)
@@ -265,61 +265,16 @@ int ttsd_config_set_default_speed(int speed)
 int ttsd_config_save_error(int uid, int uttid, const char* lang, int vctype, const char* text, 
                           const char* func, int line, const char* message)
 {
-       FILE* err_fp;
-       err_fp = fopen(SR_ERROR_FILE_NAME, "a");
-       if (NULL == err_fp) {
-               SLOG(LOG_WARN, get_tag(), "[WARNING] Fail to open error file (%s)", SR_ERROR_FILE_NAME);
-               return -1;
-       }
-       SLOG(LOG_DEBUG, get_tag(), "Save Error File (%s)", SR_ERROR_FILE_NAME);
-
-       /* func */
-       if (NULL != func) {
-               fprintf(err_fp, "function - %s\n", func);
-       }
-       
-       /* line */
-       fprintf(err_fp, "line - %d\n", line);
-
-       /* message */
-       if (NULL != message) {
-               fprintf(err_fp, "message - %s\n", message);
-       }
-
-       int ret;
-       /* uid */
-       fprintf(err_fp, "uid - %d\n", uid);
-       
-       /* uttid */
-       fprintf(err_fp, "uttid - %d\n", uttid);
+       SLOG(LOG_ERROR, get_tag(), "=============== TTS ERROR LOG ====================");
 
-       /* lang */
-       if (NULL != lang) {
-               fprintf(err_fp, "language - %s\n", lang);
-       }
-
-       /* vctype */
-       fprintf(err_fp, "vctype - %d\n", vctype);
-
-       /* text */
-       if (NULL != text) {
-               fprintf(err_fp, "text - %s\n", text);
-       }
-
-       /* get current engine */
-       char *engine_id = NULL;
-
-       ret = ttsd_engine_setting_get_engine(&engine_id);
-       if (0 != ret) {
-               SLOG(LOG_ERROR, get_tag(), "[ERROR] Fail to get current engine");
-       } else {
-               fprintf(err_fp, "current engine - %s", engine_id);
-       }
+       SLOG(LOG_ERROR, get_tag(), "uid(%d) uttid(%d)", uid, uttid);
 
-       /* get data */
-       ttsd_data_save_error_log(uid, err_fp);
+       if (NULL != func)       SLOG(LOG_ERROR, get_tag(), "Function(%s) Line(%d)", func, line);
+       if (NULL != message)    SLOG(LOG_ERROR, get_tag(), "Message(%s)", message);
+       if (NULL != lang)       SLOG(LOG_ERROR, get_tag(), "Lang(%s), type(%d)", lang, vctype);
+       if (NULL != text)       SLOG(LOG_ERROR, get_tag(), "Text(%s)", text);
 
-       fclose(err_fp);
+       SLOG(LOG_ERROR, get_tag(), "==================================================");
 
        return 0;
 }
\ No newline at end of file
index 4603af3..c9b6457 100644 (file)
@@ -188,7 +188,6 @@ int __player_result_callback(player_event_e event, int uid, int utt_id)
        switch(event) {
        case PLAYER_ERROR:
                SLOG(LOG_ERROR, get_tag(), "[SERVER ERROR][%s] player result error", __FUNCTION__);
-               __server_send_error(uid, utt_id, TTSD_ERROR_OPERATION_FAILED);
                ttsd_config_save_error(uid, utt_id, NULL, -1, NULL, __FUNCTION__, __LINE__, "PLAYER_ERROR");
 
        case PLAYER_EMPTY_SOUND_QUEUE:
@@ -765,11 +764,6 @@ int ttsd_server_stop(int uid)
                                SLOG(LOG_ERROR, get_tag(), "[Server ERROR] Fail to cancel synthesis : ret(%d)", ret);
                }
 
-               if (NULL != g_wait_timer) {
-                       SLOG(LOG_DEBUG, get_tag(), "Wait timer is deleted");
-                       ecore_timer_del(g_wait_timer);
-               }
-
                __server_set_synth_control(TTSD_SYNTHESIS_CONTROL_EXPIRED);
        } else {
                SLOG(LOG_WARN, get_tag(), "[Server WARNING] Current state is 'ready' ");