Skip to content

Commit

Permalink
better error logs
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
JarbasAl authored Feb 11, 2024
1 parent 2cd4c39 commit 3a87966
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ovos_audio/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a87966

Please sign in to comment.