diff --git a/frontend/app/video/subtitles/page.tsx b/frontend/app/video/subtitles/page.tsx index 87edd28..03d37a7 100644 --- a/frontend/app/video/subtitles/page.tsx +++ b/frontend/app/video/subtitles/page.tsx @@ -149,7 +149,18 @@ export default function SubtitlesPage() { toast.success('Subtitle processing started!'); } catch (err: any) { - toast.error(err.response?.data?.detail || 'Failed to start processing'); + console.error('Subtitle processing error:', err); + + // Handle validation errors (array of error objects) + if (err.response?.data?.detail && Array.isArray(err.response.data.detail)) { + const errorMessages = err.response.data.detail.map((e: any) => e.msg || JSON.stringify(e)).join(', '); + toast.error(`Validation error: ${errorMessages}`); + } else if (typeof err.response?.data?.detail === 'string') { + toast.error(err.response.data.detail); + } else { + toast.error('Failed to start processing'); + } + setLoading(false); } };