| 573 | /* ===== ENCODING ===== */ |
| 574 | |
| 575 | static void json_encode_exception(lua_State *l, json_config_t *cfg, strbuf_t *json, int lindex, |
| 576 | const char *reason) |
| 577 | { |
| 578 | // We don't need the buffer if error happened. |
| 579 | strbuf_free(json); |
| 580 | |
| 581 | DefoldError(cfg, "Cannot serialise %s: %s", |
| 582 | lua_typename(l, lua_type(l, lindex)), reason); |
| 583 | } |
| 584 | |
| 585 | /* json_append_string args: |
| 586 | * - lua_State |
no test coverage detected