mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)
Also add slightly richer parse errors now that we can include a string literal with returned errors. This will allow us to use TRY() when working with JSON data.
This commit is contained in:
@@ -20,11 +20,10 @@ void JsonArrayModel::invalidate()
|
||||
return;
|
||||
}
|
||||
|
||||
auto json = JsonValue::from_string(file->read_all());
|
||||
auto json = JsonValue::from_string(file->read_all()).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
VERIFY(json.has_value());
|
||||
VERIFY(json.value().is_array());
|
||||
m_array = json.value().as_array();
|
||||
VERIFY(json.is_array());
|
||||
m_array = json.as_array();
|
||||
|
||||
did_update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user