Show transcription start errors in UI, improve error logging
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user