We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2c4334 commit 2ca6dbdCopy full SHA for 2ca6dbd
deepgram/clients/live/v1/async_client.py
@@ -485,7 +485,11 @@ async def _signal_exit(self) -> None:
485
self.logger.verbose("closing socket...")
486
if self._socket is not None:
487
self.logger.verbose("send CloseStream...")
488
- await self._socket.send(json.dumps({"type": "CloseStream"}))
+ try:
489
+ # if the socket connection is closed, the following line might throw an error
490
+ await self._socket.send(json.dumps({"type": "CloseStream"}))
491
+ except Exception as e:
492
+ self.logger.error("Exception in AsyncLiveClient._signal_exit, %s", e)
493
494
await asyncio.sleep(0.5)
495
0 commit comments