mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibCore: Propagate errors from Stream::*_entire_buffer
This commit is contained in:
parent
6c7c5a6786
commit
9a3e95785e
Notes:
sideshowbarker
2024-07-17 12:02:22 +09:00
Author: https://github.com/timschumi
Commit: 9a3e95785e
Pull-request: https://github.com/SerenityOS/serenity/pull/16429
Reviewed-by: https://github.com/sin-ack ✅
17 changed files with 43 additions and 49 deletions
|
@ -471,7 +471,7 @@ ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
|
|||
auto search_engines_file = TRY(Core::Stream::File::open(Browser::search_engines_file_path(), Core::Stream::OpenMode::Read));
|
||||
auto file_size = TRY(search_engines_file->size());
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(file_size));
|
||||
if (search_engines_file->read_entire_buffer(buffer)) {
|
||||
if (!search_engines_file->read_entire_buffer(buffer).is_error()) {
|
||||
StringView buffer_contents { buffer.bytes() };
|
||||
if (auto json = TRY(JsonValue::from_string(buffer_contents)); json.is_array()) {
|
||||
auto json_array = json.as_array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue