diff --git a/drb-c2-core/app/routers/trips.py b/drb-c2-core/app/routers/trips.py index 0b3e821..2e70597 100644 --- a/drb-c2-core/app/routers/trips.py +++ b/drb-c2-core/app/routers/trips.py @@ -84,6 +84,11 @@ async def _places_search(query: str, near: str) -> list[dict]: params={"query": f"{query} {near}".strip(), "key": settings.google_maps_api_key}, ) data = r.json() + status = data.get("status") + results = data.get("results", []) + logger.info(f"Places search '{query} {near}': status={status}, count={len(results)}") + if status not in ("OK", "ZERO_RESULTS"): + logger.warning(f"Places API error: {status} — {data.get('error_message', '')}") return [ { "name": p.get("name"), @@ -92,7 +97,7 @@ async def _places_search(query: str, near: str) -> list[dict]: "maps_link": f"https://www.google.com/maps/place/?q=place_id:{p.get('place_id')}", "rating": p.get("rating"), } - for p in data.get("results", [])[:5] + for p in results[:5] ] except Exception as e: logger.error(f"Places search in assistant failed: {e}")