Skip to content

fix: preserve HTTPException status in update_docling_preset (#1586)#1814

Open
hunterxtang wants to merge 1 commit into
langflow-ai:mainfrom
hunterxtang:fix/1586-docling-preset-status
Open

fix: preserve HTTPException status in update_docling_preset (#1586)#1814
hunterxtang wants to merge 1 commit into
langflow-ai:mainfrom
hunterxtang:fix/1586-docling-preset-status

Conversation

@hunterxtang

@hunterxtang hunterxtang commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #1586

Summary by CodeRabbit

  • Bug Fixes
    • Fixed error handling for the docling-preset endpoint so client-side errors (e.g., invalid preset requests) now return their original HTTP status codes and messages instead of being converted to a generic server error. This restores correct status propagation to clients and prevents misleading 500 responses for client-induced failures.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32a96009-e468-4d56-8b45-6fd8de20c723

📥 Commits

Reviewing files that changed from the base of the PR and between e3de2b3 and cd3713f.

📒 Files selected for processing (1)
  • src/api/settings/endpoints.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/api/settings/endpoints.py

Walkthrough

The deprecated /settings/docling-preset endpoint now re-raises caught HTTPException instances in update_docling_preset, preventing them from being masked as generic 500 errors and preserving original HTTP status codes and messages.

Changes

HTTP Exception Handling Fix

Layer / File(s) Summary
HTTP exception preservation in docling-preset endpoint
src/api/settings/endpoints.py
The update_docling_preset function adds an except HTTPException block that re-raises exceptions to preserve intended HTTP status codes instead of overriding them with a generic 500 response.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing HTTPException status preservation in the update_docling_preset endpoint, with an issue reference.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added community backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. labels Jun 9, 2026
@hunterxtang hunterxtang force-pushed the fix/1586-docling-preset-status branch from e3de2b3 to cd3713f Compare June 9, 2026 16:47
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: HTTPException(400) swallowed as 500 in update_docling_preset

1 participant