Add io stream end errors

This commit is contained in:
Nikita Lisitsa 2022-06-11 13:53:13 +03:00
parent e4f212c44f
commit 142d15fdcb
2 changed files with 22 additions and 0 deletions

View file

@ -21,4 +21,16 @@ namespace psemek::io
char const * what() const noexcept override;
};
struct istream_end
: std::exception
{
char const * what() const noexcept override;
};
struct ostream_end
: std::exception
{
char const * what() const noexcept override;
};
}

View file

@ -13,4 +13,14 @@ namespace psemek::io
return "Attempt to write to null output stream";
}
char const * istream_end::what() const noexcept
{
return "Unexpected input stream end";
}
char const * ostream_end::what() const noexcept
{
return "Unexpected output stream end";
}
}