From e9a2fdfcfccddf457a9364f3c54d46004f76fea9 Mon Sep 17 00:00:00 2001 From: Conan Scott Date: Tue, 24 Mar 2026 01:27:51 +0000 Subject: [PATCH] Add error detail logging for ASR failures --- ingest.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ingest.py b/ingest.py index 8c95cc7..baad9c2 100644 --- a/ingest.py +++ b/ingest.py @@ -115,7 +115,18 @@ def transcribe_chunk_fish(chunk_path, api_key, start_offset_sec): with Session(api_key) as session: with open(chunk_path, "rb") as f: - result = session.asr(ASRRequest(audio=f.read(), language="en")) + audio_bytes = f.read() + print(f" Sending {len(audio_bytes)/1024/1024:.1f}MB to Fish Audio...", flush=True) + try: + result = session.asr(ASRRequest(audio=audio_bytes, language="en")) + except Exception as e: + # Try to get more detail on the error + resp = getattr(e, 'response', None) or getattr(e, '__cause__', None) + if resp is not None: + status = getattr(resp, 'status_code', '?') + body = getattr(resp, 'text', getattr(resp, 'content', b'')) + raise RuntimeError(f"Fish Audio ASR failed: HTTP {status} — {body}") from e + raise # Fish Audio returns timestamps in milliseconds — convert to seconds # and adjust by the chunk's start offset in the full audio