diff options
| author | 2024-04-03 08:58:44 +0200 | |
|---|---|---|
| committer | 2024-04-03 08:58:44 +0200 | |
| commit | 0f9a859f734e55ec2f853cf910c0a429ef4c77dd (patch) | |
| tree | 2e4542e55b1da8513f131db27c6cc1c898ec5ac7 /format.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.tar.gz penes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.tar.xz penes-snac2-0f9a859f734e55ec2f853cf910c0a429ef4c77dd.zip | |
Added some error logging regarding the emojis.json file.
Diffstat (limited to 'format.c')
| -rw-r--r-- | format.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -58,6 +58,8 @@ xs_dict *emojis(void) | |||
| 58 | xs_json_dump(d, 4, f); | 58 | xs_json_dump(d, 4, f); |
| 59 | fclose(f); | 59 | fclose(f); |
| 60 | } | 60 | } |
| 61 | else | ||
| 62 | srv_log(xs_fmt("Error creating '%s'", fn)); | ||
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | xs_dict *d = NULL; | 65 | xs_dict *d = NULL; |
| @@ -65,7 +67,12 @@ xs_dict *emojis(void) | |||
| 65 | if ((f = fopen(fn, "r")) != NULL) { | 67 | if ((f = fopen(fn, "r")) != NULL) { |
| 66 | d = xs_json_load(f); | 68 | d = xs_json_load(f); |
| 67 | fclose(f); | 69 | fclose(f); |
| 70 | |||
| 71 | if (d == NULL) | ||
| 72 | srv_log(xs_fmt("JSON parse error in '%s'", fn)); | ||
| 68 | } | 73 | } |
| 74 | else | ||
| 75 | srv_log(xs_fmt("Error opening '%s'", fn)); | ||
| 69 | 76 | ||
| 70 | return d; | 77 | return d; |
| 71 | } | 78 | } |