diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -1971,7 +1971,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req, | |||
| 1971 | 1971 | ||
| 1972 | 1972 | ||
| 1973 | void srv_archive_error(const char *prefix, const xs_str *err, | 1973 | void srv_archive_error(const char *prefix, const xs_str *err, |
| 1974 | const xs_dict *req, const xs_dict *data) | 1974 | const xs_dict *req, const xs_val *data) |
| 1975 | /* archives an error */ | 1975 | /* archives an error */ |
| 1976 | { | 1976 | { |
| 1977 | xs *ntid = tid(0); | 1977 | xs *ntid = tid(0); |
| @@ -1993,8 +1993,12 @@ void srv_archive_error(const char *prefix, const xs_str *err, | |||
| 1993 | if (data) { | 1993 | if (data) { |
| 1994 | fprintf(f, "Data:\n"); | 1994 | fprintf(f, "Data:\n"); |
| 1995 | 1995 | ||
| 1996 | xs *j = xs_json_dumps_pp(data, 4); | 1996 | if (xs_type(data) == XSTYPE_LIST || xs_type(data) == XSTYPE_DICT) { |
| 1997 | fwrite(j, strlen(j), 1, f); | 1997 | xs *j = xs_json_dumps_pp(data, 4); |
| 1998 | fwrite(j, strlen(j), 1, f); | ||
| 1999 | } | ||
| 2000 | else | ||
| 2001 | fprintf(f, "%s", data); | ||
| 1998 | 2002 | ||
| 1999 | fprintf(f, "\n"); | 2003 | fprintf(f, "\n"); |
| 2000 | } | 2004 | } |