From caa48ad0562aa75dae6a80f0e75a2f0b4ab39706 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 5 Feb 2019 11:26:03 +0100 Subject: [PATCH] Better error handling on the assistant --- platypush/backend/assistant/google/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/backend/assistant/google/__init__.py b/platypush/backend/assistant/google/__init__.py index c5f85b19..30893e29 100644 --- a/platypush/backend/assistant/google/__init__.py +++ b/platypush/backend/assistant/google/__init__.py @@ -79,7 +79,7 @@ class AssistantGoogleBackend(Backend): self.credentials_file = credentials_file self.device_model_id = device_model_id self.assistant = None - self._has_error =False + self._has_error = False with open(self.credentials_file, 'r') as f: self.credentials = google.oauth2.credentials.Credentials( @@ -105,7 +105,7 @@ class AssistantGoogleBackend(Backend): self.bus.post(ResponseEvent(response_text=event.args.get('text'))) elif hasattr(EventType, 'ON_RESPONDING_STARTED') and \ event.type == EventType.ON_RESPONDING_STARTED and \ - event.args.get('is_error_response'): + 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: