return parse errors via IPC for append_layout
This commit is contained in:
@ -384,7 +384,7 @@ static int json_double(void *ctx, double val) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void tree_append_json(const char *filename) {
|
||||
void tree_append_json(const char *filename, char **errormsg) {
|
||||
FILE *f;
|
||||
if ((f = fopen(filename, "r")) == NULL) {
|
||||
LOG("Cannot open file \"%s\"\n", filename);
|
||||
@ -441,6 +441,8 @@ void tree_append_json(const char *filename) {
|
||||
{
|
||||
unsigned char *str = yajl_get_error(hand, 1, (const unsigned char*)buf, n);
|
||||
ELOG("JSON parsing error: %s\n", str);
|
||||
if (errormsg != NULL)
|
||||
*errormsg = sstrdup((const char*)str);
|
||||
yajl_free_error(hand, str);
|
||||
|
||||
/* In case not all containers were restored, we need to fix the
|
||||
|
Reference in New Issue
Block a user