From d297b5cc429d5c319eb5841a0ae69b05b229ea52 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 5 Feb 2019 11:59:04 +0100 Subject: [PATCH] Trying to make a more resiliant assistant error handling --- platypush/backend/assistant/google/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/assistant/google/__init__.py b/platypush/backend/assistant/google/__init__.py index 30893e29..fd43af41 100644 --- a/platypush/backend/assistant/google/__init__.py +++ b/platypush/backend/assistant/google/__init__.py @@ -90,6 +90,7 @@ class AssistantGoogleBackend(Backend): def _process_event(self, event): self.logger.info('Received assistant event: {}'.format(event)) + self._has_error = False if event.type == EventType.ON_CONVERSATION_TURN_STARTED: self.bus.post(ConversationStartEvent()) @@ -107,7 +108,6 @@ class AssistantGoogleBackend(Backend): event.type == EventType.ON_RESPONDING_STARTED and \ event.args.get('is_error_response', False) is True: self.logger.warning('Assistant response error') - self._has_error = True elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED: phrase = event.args['text'].lower().strip() self.logger.info('Speech recognized: {}'.format(phrase))