Skip to content

Handle CV parse failures and record error reason#6

Open
dogussyaman wants to merge 1 commit intomainfrom
codex/generate-error-for-missing-cvtext
Open

Handle CV parse failures and record error reason#6
dogussyaman wants to merge 1 commit intomainfrom
codex/generate-error-for-missing-cvtext

Conversation

@dogussyaman
Copy link
Owner

Motivation

  • Ensure the function fails fast when a CV has no extracted text instead of using a placeholder value so parsing cannot proceed on invalid input.
  • Surface processing failures on the CV record itself by marking the CV as failed and storing an explanatory reason.
  • Prevent partial or incorrect updates to parsed_data/raw_text when parsing was not successful.

Description

  • Capture the incoming cv_id early into requestCvId so the error handler can update the correct CV without re-reading the request body (added in supabase/functions/cv-process/index.ts).
  • Throw an error when cv.raw_text is missing instead of assigning a placeholder string by replacing the previous fallback with throw new Error("CV raw_text is missing; cannot parse CV without extracted text.").
  • In the top-level catch block, update the cvs row to set status: "failed" and store error_reason with the error message when requestCvId is available.
  • Keep the existing flow that only writes status: "processed", raw_text, and parsed_data after successful parsing, preventing those fields from being updated on failures.

Testing

  • No automated tests or CI jobs were executed for this change.

Codex Task

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-crafters Ready Ready Preview, Comment Feb 4, 2026 10:06am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant