1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

Streams: Distinguish recoverable and fatal errors.

This commit is contained in:
asynts 2020-08-31 13:12:15 +02:00 committed by Andreas Kling
parent daeb2bdc60
commit 9ce4475907
9 changed files with 75 additions and 59 deletions

View file

@ -57,7 +57,7 @@ public:
bool read_or_error(Bytes bytes) override
{
if (read(bytes) != bytes.size()) {
m_error = true;
set_fatal_error();
return false;
}
@ -92,7 +92,7 @@ public:
if (m_bit_offset++ == 7)
m_next_byte.clear();
} else if (m_stream.eof()) {
m_error = true;
set_fatal_error();
return 0;
} else {
m_stream >> m_next_byte;