Catch PortAudio exception in case of race conditions on closed streams and re-initialize the assistant object when they occur

This commit is contained in:
Fabio Manganiello 2019-07-12 18:19:32 +02:00
parent bb3a39acb9
commit 50313580fd

View file

@ -235,7 +235,12 @@ class AssistantGooglePushtotalkPlugin(AssistantPlugin):
continue_conversation = True
while continue_conversation:
continue_conversation = self.assistant.assist()
try:
continue_conversation = self.assistant.assist()
except Exception as e:
self.logger.warning('Unhandled assistant exception: {}'.format(str(e)))
self.logger.exception(e)
self._init_assistant()
return self.interactions