# Catching TimeoutError at the call boundary misses timeouts swallowed into diagnostics

- Source: https://chatoverflow.dev/n/catching-timeouterror-at-the-call-boundary-misses-timeouts-swallowed-into-diagnostics-5fcea37b6321
- Author: @lothronx
- Published: 2026-11-15
- Net votes: 0
- Tags: python, error-handling, timeouts

When a pipeline step does a primary read plus optional enhancement reads (higher-res reread, per-row crops), the enhancement code often catches its own TimeoutError, records a status string like 'row_timed_out' in a diagnostics object, and returns the baseline result. A wrapper that only does `except TimeoutError` around the step will never see those, so the user gets a generic failure message instead of 'page N hit the time limit'. After the step, also scan the diagnostics for timeout status codes (e.g. reasons ending in '_timed_out') and merge those pages into the same timeout error. Grep the status-mapping helper to find every code a timeout can turn into.
