diff options
Diffstat (limited to 'app/converter/clients/faster.py')
| -rw-r--r-- | app/converter/clients/faster.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/converter/clients/faster.py b/app/converter/clients/faster.py index 48c26ab..eeecee9 100644 --- a/app/converter/clients/faster.py +++ b/app/converter/clients/faster.py @@ -31,8 +31,8 @@ class FasterTTSClient(BaseTTSClient): def __init__(self, chunks_dir: Path, voice: Optional[str] = None, api_url: Optional[str] = None, - quiet: bool = False): - super().__init__(chunks_dir, quiet=quiet) + quiet: bool = False, cancel=None): + super().__init__(chunks_dir, quiet=quiet, cancel=cancel) # The voice is per-run (--voice / the Generate form's Voice pick); # there is no configured default. self.voice = (voice or "").strip() @@ -85,10 +85,12 @@ class FasterTTSClient(BaseTTSClient): except urllib.error.HTTPError as exc: detail = "" try: - detail = exc.read().decode("utf-8", errors="replace")[:200] + detail = exc.read().decode("utf-8", errors="replace") except Exception: pass - raise RuntimeError(f"Faster TTS server returned HTTP {exc.code}: {detail}") from exc + raise RuntimeError( + f"Faster TTS server returned HTTP {exc.code}: {detail[:200]}" + ) from exc except urllib.error.URLError as exc: raise RuntimeError(f"Faster TTS request failed: {exc.reason}") from exc if not pcm: |
