mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-02 16:25:34 +03:00
Utilities/lsirq: Propagate errors in JSON decoding
This commit is contained in:
parent
bceddb2073
commit
9d6ecdca7b
Notes:
sideshowbarker
2024-07-17 21:54:24 +09:00
Author: https://github.com/creator1creeper1 Commit: https://github.com/SerenityOS/serenity/commit/9d6ecdca7b4 Pull-request: https://github.com/SerenityOS/serenity/pull/11420
@ -39,7 +39,12 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
|
|||||||
|
|
||||||
outln(" CPU0");
|
outln(" CPU0");
|
||||||
auto file_contents = proc_interrupts->read_all();
|
auto file_contents = proc_interrupts->read_all();
|
||||||
auto json = JsonValue::from_string(file_contents).release_value_but_fixme_should_propagate_errors();
|
auto json_or_error = JsonValue::from_string(file_contents);
|
||||||
|
if (json_or_error.is_error()) {
|
||||||
|
warnln("Error: {}", json_or_error.error());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
auto json = json_or_error.release_value();
|
||||||
json.as_array().for_each([](auto& value) {
|
json.as_array().for_each([](auto& value) {
|
||||||
auto& handler = value.as_object();
|
auto& handler = value.as_object();
|
||||||
auto purpose = handler.get("purpose").to_string();
|
auto purpose = handler.get("purpose").to_string();
|
||||||
|
Loading…
Reference in New Issue
Block a user