input/TextInputStream: ReadLine() throws exception on error

This commit is contained in:
Max Kellermann 2018-01-20 19:36:08 +01:00
parent 926d4150c5
commit 4ca1089f60
2 changed files with 4 additions and 9 deletions

View File

@ -59,14 +59,7 @@ TextInputStream::ReadLine()
character */
--dest.size;
size_t nbytes;
try {
nbytes = is->LockRead(dest.data, dest.size);
} catch (...) {
LogError(std::current_exception());
return nullptr;
}
size_t nbytes = is->LockRead(dest.data, dest.size);
buffer.Append(nbytes);

View File

@ -47,7 +47,9 @@ public:
/**
* 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();
};