From 8f9e339711b27e95a92546c3a09a8fdc47486ec0 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Tue, 7 Apr 2026 22:18:28 +0200 Subject: [PATCH] Add error handling and UI feedback for profile extraction failures --- web/components/optional-profile-form.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/components/optional-profile-form.tsx b/web/components/optional-profile-form.tsx index 94cdb70f..78b254d4 100644 --- a/web/components/optional-profile-form.tsx +++ b/web/components/optional-profile-form.tsx @@ -90,6 +90,7 @@ export const OptionalProfileUserForm = (props: { const [isExtracting, setIsExtracting] = useState(false) const [parsingEditor, setParsingEditor] = useState(null) const [extractionProgress, setExtractionProgress] = useState(0) + const [extractionError, setExtractionError] = useState(null) const handleLLMExtract = async (): Promise> => { const llmContent = parsingEditor?.getText?.() ?? '' @@ -99,6 +100,7 @@ export const OptionalProfileUserForm = (props: { } setIsExtracting(true) setExtractionProgress(0) + setExtractionError(null) const startTime = Date.now() setInterval(() => { const elapsed = (Date.now() - startTime) / 1000 @@ -185,10 +187,10 @@ export const OptionalProfileUserForm = (props: { return extractedProfile } catch (error) { console.error(error) - toast.error( + setExtractionError( t( 'profile.llm.extract.error', - 'Failed to extract profile data. Try again later or contact support.', + 'Profile extraction failed. No worries — you can fill in your profile manually, or save it now and come back to extract later.', ), ) Sentry.captureException(error, { @@ -322,7 +324,11 @@ export const OptionalProfileUserForm = (props: { onExtract={handleLLMExtract} progress={extractionProgress} /> - + {extractionError && ( +

+ {extractionError} +

+ )}