mirror of https://github.com/AxioDL/metaforce.git
Nicer exception handler
This commit is contained in:
parent
1d4786344a
commit
4acfa934fa
|
@ -23,7 +23,11 @@ size_t CBlenderConnection::_readLine(char* buf, size_t bufSz)
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (readBytes >= bufSz)
|
if (readBytes >= bufSz)
|
||||||
|
{
|
||||||
throw std::length_error("Pipe buffer overrun");
|
throw std::length_error("Pipe buffer overrun");
|
||||||
|
*(buf-1) = '\0';
|
||||||
|
return bufSz - 1;
|
||||||
|
}
|
||||||
ssize_t ret = read(m_readpipe[0], buf, 1);
|
ssize_t ret = read(m_readpipe[0], buf, 1);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in New Issue