Show transcription start errors in UI, improve error logging
All checks were successful
Tests / Python Backend Tests (push) Successful in 5s
Tests / Frontend Tests (push) Successful in 8s
Tests / Rust Sidecar Tests (push) Successful in 2m5s

Start Transcription button now shows the error message when it fails
instead of silently reverting. Common causes:
- Missing PortAudio library on Linux
- Audio device not accessible
- Deepgram connection failure

Also added error details to backend console output and captured
the last error from the Deepgram engine for better diagnostics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-04-08 12:15:43 -07:00
parent b91fe876f9
commit a3bcc5bee5
3 changed files with 27 additions and 3 deletions

View File

@@ -8,9 +8,12 @@
);
let isLoading = $state(false);
let errorMessage = $state("");
async function toggleTranscription() {
if (isLoading) return;
isLoading = true;
errorMessage = "";
try {
if (isTranscribing) {
await backendStore.apiPost("/api/stop");
@@ -20,8 +23,10 @@
// Poll status to update UI immediately instead of waiting
// for WebSocket broadcast (which can be delayed or missed)
await backendStore.pollStatus();
} catch (err) {
console.error("Failed to toggle transcription:", err);
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : String(err);
console.error("Failed to toggle transcription:", msg);
errorMessage = msg;
} finally {
isLoading = false;
}
@@ -104,9 +109,19 @@
<button onclick={saveTranscriptions} disabled={!backendStore.connected}>
Save
</button>
{#if errorMessage}
<span class="error-msg">{errorMessage}</span>
{/if}
</div>
<style>
.error-msg {
color: #f44336;
font-size: 12px;
margin-left: 8px;
}
.controls {
display: flex;
align-items: center;