mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Utilities/mount: Propagate errors in JSON decoding
This commit is contained in:
parent
904c8634eb
commit
bceddb2073
Notes:
sideshowbarker
2024-07-17 21:54:28 +09:00
Author: https://github.com/creator1creeper1 Commit: https://github.com/SerenityOS/serenity/commit/bceddb20739 Pull-request: https://github.com/SerenityOS/serenity/pull/11420
@ -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…
Reference in New Issue
Block a user