Fix logs when Mimic is not found

If Mimic was not found at all the LOG message would raise an exception,
this fixes that issue and cleans up Exception chain
pull/2718/head
Åke Forslund 2020-10-10 08:53:25 +02:00
parent 58415e71d4
commit a2dc3482ef
1 changed files with 7 additions and 3 deletions

View File

@ -185,10 +185,14 @@ class MimicValidator(TTSValidator):
def validate_connection(self):
try:
subprocess.call([BIN, '--version'])
except Exception:
LOG.info("Failed to find mimic at: " + BIN)
except Exception as err:
if BIN:
LOG.error('Failed to find mimic at: {}'.format(BIN))
else:
LOG.error('Mimic executable not found')
raise Exception(
'Mimic was not found. Run install-mimic.sh to install it.')
'Mimic was not found. Run install-mimic.sh to install it.') \
from err
def get_tts_class(self):
return Mimic