From 223161ba8f97e969c3a085f41b1b9bdc1536a3e6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 26 Jan 2023 11:46:29 +0900 Subject: [PATCH] Add error logs Change-Id: Id6d2a69239b1667a450ca6b86e7bdb888b7f5de3 Signed-off-by: Jihoon Kim --- client/autofill.c | 8 +++++++- client/autofill_fill_request.c | 5 ++++- common/autofill_view_info.c | 15 ++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index c3254d6..fac30bd 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -316,8 +316,12 @@ EXPORT_API int autofill_create(autofill_h *ah) EXPORT_API int autofill_destroy(autofill_h ah) { - if (!ah) + LOGI(""); + + if (!ah) { + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; + } ah->connection_callback = NULL; ah->autofill_fill_response_received_cb = NULL; @@ -331,6 +335,8 @@ EXPORT_API int autofill_destroy(autofill_h ah) free(ah); + LOGI("return error none"); + return AUTOFILL_ERROR_NONE; } diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 40ff834..0b5f179 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -133,6 +133,7 @@ EXPORT_API int autofill_cancel_fill_request(autofill_h ah, autofill_view_info_h } if (!ah->rpc_h) { + LOGW("[ERROR] Operation failed"); return AUTOFILL_ERROR_OPERATION_FAILED; } @@ -190,8 +191,10 @@ EXPORT_API int autofill_cancel_fill_request(autofill_h ah, autofill_view_info_h LOGW("[ERROR] Failed to cancel fill request. rpc err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } - else + else { + LOGI("return error none"); return AUTOFILL_ERROR_NONE; + } } EXPORT_API int autofill_fill_response_set_received_cb(autofill_h ah, autofill_fill_response_received_cb callback, void *user_data) diff --git a/common/autofill_view_info.c b/common/autofill_view_info.c index 9d773df..9fc3b62 100644 --- a/common/autofill_view_info.c +++ b/common/autofill_view_info.c @@ -30,12 +30,16 @@ EXPORT_API int autofill_view_info_create(autofill_view_info_h *vi) { - if (!vi) + if (!vi) { + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; + } struct autofill_view_info_s *vs = (struct autofill_view_info_s *)calloc(1, sizeof(struct autofill_view_info_s)); - if (!vs) + if (!vs) { + LOGW("[ERROR] Out of memory"); return AUTOFILL_ERROR_OUT_OF_MEMORY; + } *vi = (autofill_view_info_h)vs; @@ -44,8 +48,11 @@ EXPORT_API int autofill_view_info_create(autofill_view_info_h *vi) EXPORT_API int autofill_view_info_destroy(autofill_view_info_h vi) { - if (!vi) + LOGI("autofill_view_info_destroy"); + if (!vi) { + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; + } if (vi->app_id) { free(vi->app_id); @@ -64,6 +71,8 @@ EXPORT_API int autofill_view_info_destroy(autofill_view_info_h vi) free(vi); + LOGI("return error none"); + return AUTOFILL_ERROR_NONE; } -- 2.7.4