mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
Userland: Handle invalid JSON in 'jp'
This commit is contained in:
parent
f4f3ab0ad9
commit
718a45ef71
1 changed files with 4 additions and 1 deletions
|
@ -66,7 +66,10 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto file_contents = file->read_all();
|
auto file_contents = file->read_all();
|
||||||
auto json = JsonValue::from_string(file_contents);
|
auto json = JsonValue::from_string(file_contents);
|
||||||
ASSERT(json.has_value());
|
if (!json.has_value()) {
|
||||||
|
fprintf(stderr, "Couldn't parse %s as JSON\n", path);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
print(json.value());
|
print(json.value());
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue