You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ingestor): ParseError(ValueError) escapes as HTTP 500 for encrypted/oversized PDFs #282
ParseError(ValueError) raised by PyMuPDFParser.parse() for encrypted or oversized PDFs is caught at ingestor.py:214 by except (AssertionError, ValueError, TypeError): raise, which re-raises it bare. FastAPI has no handler for raw ValueError, so callers receive HTTP 500.
Root cause
Fix #242/#246 added class ParseError(ValueError) in parser.py. But PipelineIngestor at line 214 has except (AssertionError, ValueError, TypeError): raise which catches ParseError (since it IS a ValueError) and re-raises before it can be mapped to a user-friendly error.
Fix
backend/app/adapters/ingestor.py -- catch ParseError before the generic ValueError catch and map it to a 422:
from ingestion.parser import ParseError
except ParseError as exc: raise validation_error(str(exc)) from exc
(then the existing ValueError block re-raises)
Impact
Users uploading encrypted PDFs or files >100 MB receive HTTP 500 instead of 422.
Activity
fix(sprint-r4): root-cause fixes for all 17 bugs from code review rou…
piyushmakhija28 commentedon Jun 21, 2026
Fixed in PR #280 (Sprint R3/R4: fix(sprint-r3): root-cause fixes for all 39 bugs from code review round 3 + Sprint R4 round 4)