mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Fix print_errors in elastic.c
This commit is contained in:
parent
7d96d62983
commit
0ce341d8e6
@ -240,7 +240,10 @@ void print_errors(response_t *r) {
|
|||||||
} else if (errors->valueint != 0) {
|
} else if (errors->valueint != 0) {
|
||||||
cJSON *err;
|
cJSON *err;
|
||||||
cJSON_ArrayForEach(err, cJSON_GetObjectItem(ret_json, "items")) {
|
cJSON_ArrayForEach(err, cJSON_GetObjectItem(ret_json, "items")) {
|
||||||
if (cJSON_GetObjectItem(cJSON_GetObjectItem(err, "index"), "status")->valueint != 201) {
|
|
||||||
|
int status = cJSON_GetObjectItem(cJSON_GetObjectItem(err, "index"), "status")->valueint;
|
||||||
|
|
||||||
|
if (status != 201 && status != 200) {
|
||||||
char *str = cJSON_Print(err);
|
char *str = cJSON_Print(err);
|
||||||
LOG_ERRORF("elastic.c", "%s\n", str);
|
LOG_ERRORF("elastic.c", "%s\n", str);
|
||||||
cJSON_free(str);
|
cJSON_free(str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user