From e3e83735264bde20eafd99d4fb8545a974939770 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 19 May 2026 20:37:21 +0200 Subject: [PATCH] fix(transcription): throw error from markAllReviewed() on non-2xx response Previously the function silently returned on failure, leaving no way for callers to detect or surface the error to the user. Co-Authored-By: Claude Sonnet 4.6 --- .../document/transcription/useTranscriptionBlocks.svelte.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/document/transcription/useTranscriptionBlocks.svelte.ts b/frontend/src/lib/document/transcription/useTranscriptionBlocks.svelte.ts index 3a601f1a..da864ad8 100644 --- a/frontend/src/lib/document/transcription/useTranscriptionBlocks.svelte.ts +++ b/frontend/src/lib/document/transcription/useTranscriptionBlocks.svelte.ts @@ -119,7 +119,11 @@ export function createTranscriptionBlocks( const res = await fetchImpl(`/api/documents/${documentId()}/transcription-blocks/review-all`, { method: 'PUT' }); - if (!res.ok) return; + if (!res.ok) { + const body = await res.json().catch(() => ({})); + // Never render body.message — route through getErrorMessage() to prevent leaking backend internals + throw new Error((body as { code?: string })?.code ?? 'INTERNAL_ERROR'); + } const updated = (await res.json()) as { id: string; reviewed: boolean }[]; for (const b of updated) { const existing = blocks.find((x) => x.id === b.id);