debug(backend): log safe_query exceptions and rollback on failure
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 45s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m5s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 31s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-27 22:00:27 +00:00
parent cd1c649d0f
commit 55749bdfaf

View File

@@ -319,7 +319,10 @@ def get_supplementary_data(db: Session, urn: int) -> dict:
if latest_field:
q = q.order_by(getattr(model, latest_field).desc())
return q.first()
except Exception:
except Exception as e:
import logging
logging.getLogger(__name__).error("safe_query failed for %s: %s", model.__name__, e)
db.rollback()
return None
# Latest Ofsted inspection