Skip to content

fix: ImageConverter gracefully handles LLM API failures (fixes #1942) - #1948

Open
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:fix-1942-image-llm-error-handling
Open

fix: ImageConverter gracefully handles LLM API failures (fixes #1942)#1948
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:fix-1942-image-llm-error-handling

Conversation

@hanhan761

Copy link
Copy Markdown

Summary

ImageConverter._get_llm_description() crashes the entire conversion pipeline when the LLM API call fails (auth error, rate limit, network timeout). The API call at _image_converter.py:137 had no error handling.

This fix wraps the API call in a try/except block, matching the pattern already used by PptxConverter (lines 119-129). On failure, it returns None and the converter gracefully skips the LLM description while still returning extracted metadata.

Issue

Fixes #1942

Verification

  • 6/7 existing tests pass (1 pre-existing failure due to missing outlook dependency)
  • Conversion without LLM client works unchanged

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImageConverter crashes when LLM API call fails (auth error, rate limit, etc.)

1 participant