From 0f9a859f734e55ec2f853cf910c0a429ef4c77dd Mon Sep 17 00:00:00 2001 From: default Date: Wed, 3 Apr 2024 08:58:44 +0200 Subject: Added some error logging regarding the emojis.json file. --- format.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'format.c') diff --git a/format.c b/format.c index f89fe21..92901bb 100644 --- a/format.c +++ b/format.c @@ -58,6 +58,8 @@ xs_dict *emojis(void) xs_json_dump(d, 4, f); fclose(f); } + else + srv_log(xs_fmt("Error creating '%s'", fn)); } xs_dict *d = NULL; @@ -65,7 +67,12 @@ xs_dict *emojis(void) if ((f = fopen(fn, "r")) != NULL) { d = xs_json_load(f); fclose(f); + + if (d == NULL) + srv_log(xs_fmt("JSON parse error in '%s'", fn)); } + else + srv_log(xs_fmt("Error opening '%s'", fn)); return d; } -- cgit v1.2.3