forked from fair/matrix-puppeteer-line
Catch IncompleteReadError
It can happen when the input stream closes after a timeout.
This commit is contained in:
parent
6f62eb0054
commit
d894eafc21
|
@ -152,6 +152,9 @@ class RPCClient:
|
||||||
try:
|
try:
|
||||||
line += await self._reader.readuntil()
|
line += await self._reader.readuntil()
|
||||||
break
|
break
|
||||||
|
except asyncio.exceptions.IncompleteReadError as e:
|
||||||
|
line += e.partial
|
||||||
|
break
|
||||||
except asyncio.exceptions.LimitOverrunError as e:
|
except asyncio.exceptions.LimitOverrunError as e:
|
||||||
self.log.warning(f"Buffer overrun: {e}")
|
self.log.warning(f"Buffer overrun: {e}")
|
||||||
line += await self._reader.read(self._reader._limit)
|
line += await self._reader.read(self._reader._limit)
|
||||||
|
|
Loading…
Reference in New Issue