From 6bda1e2fbc0ba3917516d230882a165f3383c901 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 2 Dec 2014 14:19:18 +0100 Subject: Improve logging on communication failure with marytts server --- client/tts.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tts.py b/client/tts.py index 88625ad..1cd95df 100644 --- a/client/tts.py +++ b/client/tts.py @@ -419,8 +419,13 @@ class MaryTTS(AbstractTTSEngine): @property def languages(self): - r = self.session.get(self._makeurl('/locales')) - r.raise_for_status() + try: + r = self.session.get(self._makeurl('/locales')) + r.raise_for_status() + except requests.exceptions.RequestException: + self._logger.critical("Communication with MaryTTS server at %s " + + "failed.", self.netloc) + raise return r.text.splitlines() @property -- cgit v1.3.1