From bad351b1d738c3ca42d2516c643bf9b5f5144c57 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Mon, 18 Dec 2023 12:20:07 +0100 Subject: rest: log failed to delete entry from table add logging to report failure to remove entry. --- src/rest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rest.c b/src/rest.c index fba807f..7685e05 100644 --- a/src/rest.c +++ b/src/rest.c @@ -2026,6 +2026,8 @@ static int og_cmd_post_client_delete(json_t *element, return -1; } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; @@ -2828,6 +2830,8 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params) return -1; } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; @@ -4989,6 +4993,8 @@ static int og_cmd_post_center_delete(json_t *element, } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; @@ -5631,6 +5637,8 @@ static int og_cmd_post_repository_delete(json_t *element, return -1; } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; @@ -5791,6 +5799,8 @@ static int og_cmd_post_room_delete(json_t *element, return -1; } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; @@ -6262,6 +6272,8 @@ static int og_cmd_delete_server(json_t *element, return -1; } if (dbi_result_get_numrows_affected(result) < 1) { + syslog(LOG_ERR, "delete did not modify any row (%s:%d)\n", + __func__, __LINE__); dbi_result_free(result); og_dbi_close(dbi); return -1; -- cgit v1.2.3-18-g5258