JsonConfig: more friendly error message

This commit is contained in:
李通洲
2023-10-30 09:14:13 +08:00
parent 3a84a1a5fa
commit 08a717f5f7
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -622,7 +622,7 @@ static void run(FFdata* data)
(error = ffOptionsParseLibraryJsonConfig(&instance.config.library, root)) ||
false
) {
fputs(error, stderr);
fprintf(stderr, "JsonConfig Error: %s\n", error);
exit(477);
}
}
+4
View File
@@ -146,6 +146,10 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
options->noBuffer = yyjson_get_bool(val);
else if (ffStrEqualsIgnCase(key, "keyWidth"))
options->keyWidth = (uint32_t) yyjson_get_uint(val);
else if (ffStrStartsWithIgnCase(key, "percent"))
return "Property `display.percentX` has been changed to `display.percent.x`";
else if (ffStrStartsWithIgnCase(key, "size"))
return "Property `display.sizeX` has been changed to `display.size.x`";
else
return "Unknown display property";
}
+5
View File
@@ -38,6 +38,11 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va
options->wmiTimeout = (int32_t) yyjson_get_int(val);
#endif
else if (ffStrEqualsIgnCase(key, "stat"))
return "Property `general.stat` has been changed to `display.stat`";
else if (ffStrEqualsIgnCase(key, "pipe"))
return "Property `general.pipe` has been changed to `display.pipe`";
else
return "Unknown general property";
}