mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 21:17:44 +00:00
AK: Remove fatal() from InputStream.
Fatal errors can not be handeled and lead to an assertion error when the stream is destroyed. It makes no sense to delay the assertion failure, instead of setting m_fatal, an assertion should be done directly.
This commit is contained in:
parent
31e7f435cb
commit
6d15318560
2 changed files with 10 additions and 12 deletions
|
@ -37,17 +37,15 @@ class Stream {
|
|||
public:
|
||||
virtual ~Stream()
|
||||
{
|
||||
ASSERT(!error() && !fatal());
|
||||
ASSERT(!error());
|
||||
}
|
||||
|
||||
bool error() const { return m_error; }
|
||||
bool fatal() const { return m_fatal; }
|
||||
|
||||
bool handle_error() { return exchange(m_error, false); }
|
||||
|
||||
protected:
|
||||
mutable bool m_error { false };
|
||||
mutable bool m_fatal { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue