Skip to content

fix(ingestor): bare except Exception around update_residency_region reclassifies all exceptions as DependencyUnavailable 503 #290

Closed

Description

@piyushmakhija28

Summary

The try/except Exception block around update_residency_region in ingestor.py (lines ~236-253) unconditionally converts any exception type to DependencyUnavailable(503). If update_residency_region raises a ProblemException (typed 409/404), the bare except converts it to a generic 503, destroying the original status code.

Root cause

Fix #266 replaced the silent pass with a proper except Exception that logs and raises DependencyUnavailable. But it uses bare Exception which is too broad.

Fix

backend/app/adapters/ingestor.py lines ~236-253: narrow the except to the actually expected types (SQLAlchemyError, ConnectionError, IOError), and let ProblemException or other typed exceptions propagate naturally.

Impact

Any typed exception from update_residency_region (including valid conflict/not-found errors) is silently misclassified as a 503 availability error, making diagnosis impossible.

Activity

  1. piyushmakhija28 commented on Jun 21, 2026

    @piyushmakhija28
    ContributorAuthor

    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)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-reviewFound via automated code reviewpriority: mediumFunctional error with workaround

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions