Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,11 +59,13 @@ def get_places_data(query, location, radius=5000, api_key="GOOGLE_API_KEY"):
|
|
59 |
"radius": radius,
|
60 |
"key": api_key
|
61 |
}
|
62 |
-
|
63 |
-
|
|
|
64 |
data = response.json()
|
65 |
return data.get('results', [])
|
66 |
-
|
|
|
67 |
return []
|
68 |
|
69 |
# Map generation function
|
|
|
59 |
"radius": radius,
|
60 |
"key": api_key
|
61 |
}
|
62 |
+
try:
|
63 |
+
response = requests.get(url, params=params)
|
64 |
+
response.raise_for_status()
|
65 |
data = response.json()
|
66 |
return data.get('results', [])
|
67 |
+
except requests.exceptions.RequestException as e:
|
68 |
+
print(f"Error fetching places data: {e}")
|
69 |
return []
|
70 |
|
71 |
# Map generation function
|