Google's expected crashes are now a warning - code should be pollished

This commit is contained in:
Hugvey Central Command 2019-05-16 16:40:46 +02:00
parent 90e6fd1ed8
commit be10bfe44c
1 changed files with 48 additions and 46 deletions

View File

@ -170,7 +170,10 @@ class GoogleVoiceClient(object):
self.restart = False
self.logger.warn("Restart Google Voice. Language: {}".format(self.language_code))
except Exception as e:
self.logger.critical(f"Crashed Google Voice: {e}")
if "305" in str(e):
self.logger.warning(f"Long Google Voice: {e}")
else:
self.logger.critical(f"Crashed Google Voice: {e}")
# sending an extra message is deprecated since we ignore finals anyway
# make sure we always send a 'final' transcript.
@ -229,4 +232,3 @@ class GoogleVoiceClient(object):
def __del__(self):
self.logger.warn("Destroyed google object")