Commit 4ca1089f authored by Max Kellermann's avatar Max Kellermann

input/TextInputStream: ReadLine() throws exception on error

parent 926d4150
...@@ -59,14 +59,7 @@ TextInputStream::ReadLine() ...@@ -59,14 +59,7 @@ TextInputStream::ReadLine()
character */ character */
--dest.size; --dest.size;
size_t nbytes; size_t nbytes = is->LockRead(dest.data, dest.size);
try {
nbytes = is->LockRead(dest.data, dest.size);
} catch (...) {
LogError(std::current_exception());
return nullptr;
}
buffer.Append(nbytes); buffer.Append(nbytes);
......
...@@ -47,7 +47,9 @@ public: ...@@ -47,7 +47,9 @@ public:
/** /**
* Reads the next line from the stream with newline character stripped. * Reads the next line from the stream with newline character stripped.
* *
* @return a pointer to the line, or nullptr on end-of-file or error * Throws on error.
*
* @return a pointer to the line, or nullptr on end-of-file
*/ */
char *ReadLine(); char *ReadLine();
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment