Added error handling for geocoder HTTP error
This commit is contained in:
parent
68b92b8bd2
commit
367abfc325
@ -45,7 +45,10 @@ async def async_fetch_building_id(
|
||||
async with session.get(
|
||||
"https://geocode.gate.petersburg.ru/parse/eas", params={"street": street}
|
||||
) as r:
|
||||
try:
|
||||
res = await r.json()
|
||||
except aiohttp.client_exceptions.ContentTypeError:
|
||||
res = "error"
|
||||
|
||||
if "error" in res:
|
||||
return None, None, None
|
||||
|
Loading…
x
Reference in New Issue
Block a user