mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
Utilities/mount: Propagate errors in JSON decoding
This commit is contained in:
parent
904c8634eb
commit
bceddb2073
1 changed files with 6 additions and 1 deletions
|
@ -124,7 +124,12 @@ static bool print_mounts()
|
|||
}
|
||||
|
||||
auto content = df->read_all();
|
||||
auto json = JsonValue::from_string(content).release_value_but_fixme_should_propagate_errors();
|
||||
auto json_or_error = JsonValue::from_string(content);
|
||||
if (json_or_error.is_error()) {
|
||||
warnln("Failed to decode JSON: {}", json_or_error.error());
|
||||
return false;
|
||||
}
|
||||
auto json = json_or_error.release_value();
|
||||
|
||||
json.as_array().for_each([](auto& value) {
|
||||
auto& fs_object = value.as_object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue