From 3a879665cfb14debba518a6705a72dd798b0dbb4 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:00:19 +0000 Subject: [PATCH] better error logs when no fallback tts is loaded dont try to execute TTS, log an error and return instead makes logs more readable, instead of the error below hiding the real issue ``` During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/.venvs/ovos/lib/python3.9/site-packages/ovos_audio/service.py", line 380, in execute_fallback_tts tts.execute(utterance, ident, listen, AttributeError: 'NoneType' object has no attribute 'execute' ``` --- ovos_audio/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ovos_audio/service.py b/ovos_audio/service.py index ed168d8..cafd1e8 100644 --- a/ovos_audio/service.py +++ b/ovos_audio/service.py @@ -376,6 +376,9 @@ def execute_fallback_tts(self, utterance, ident, listen, message: Message = None """ try: tts = self._get_tts_fallback() + if tts is None: + LOG.error("No fallback TTS available and main TTS failed!") + return LOG.debug("TTS fallback, utterance : " + str(utterance)) tts.execute(utterance, ident, listen, message=message) # accepts random kwargs