Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions custom_components/google_contacts/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Coordinator for fetching data from Google Contacts API."""

from aiodns.error import DNSError
import asyncio
from collections.abc import AsyncGenerator, Sequence
from contextlib import asynccontextmanager
Expand Down Expand Up @@ -363,6 +364,13 @@ async def _async_request_synchronize_contacts(
await self._async_request_get_contacts(store)
return

except DNSError as dnsError:
_LOGGER.error(
"DNS error synchronizing contacts: %s. Not performing update",
dnsError,
)
return

for contact in contacts.contacts.values():
if contact.deleted:
_LOGGER.info("Removing contact: %s", contact.resource_name)
Expand Down Expand Up @@ -401,6 +409,13 @@ async def _async_request_synchronize_groups(
await self._async_request_get_groups(store)
return

except DNSError as dnsError:
_LOGGER.error(
"DNS error synchronizing groups: %s. Not performing update",
dnsError,
)
return

for group in groups.groups.values():
if group.deleted:
_LOGGER.info("Removing group: %s", group.resource_name)
Expand Down
Loading