mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 11:14:58 +00:00
LibCore: Propagate errors from Stream::*_entire_buffer
This commit is contained in:
parent
6c7c5a6786
commit
9a3e95785e
17 changed files with 43 additions and 49 deletions
|
@ -17,8 +17,7 @@ static DeprecatedString read_all(DeprecatedString const& path)
|
|||
auto file = MUST(Core::Stream::File::open(path, Core::Stream::OpenMode::Read));
|
||||
auto file_size = MUST(file->size());
|
||||
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
|
||||
if (!file->read_entire_buffer(content.bytes()))
|
||||
VERIFY_NOT_REACHED();
|
||||
MUST(file->read_entire_buffer(content.bytes()));
|
||||
return DeprecatedString { content.bytes() };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue