Commit 9573dece authored by Adrian Georgescu's avatar Adrian Georgescu

Capture exception when fetching Google Contacts

parent dd8fe679
...@@ -946,9 +946,13 @@ class GoogleContactsManager(object, metaclass=Singleton): ...@@ -946,9 +946,13 @@ class GoogleContactsManager(object, metaclass=Singleton):
settings = SIPSimpleSettings() settings = SIPSimpleSettings()
settings.google_contacts.username = notification.data.email settings.google_contacts.username = notification.data.email
settings.save() settings.save()
self._service = build('people', 'v1', credentials=notification.data.credentials, http=Http(timeout=10), cache_discovery=False) # todo: what's the best fix for cache? try:
self.active = True self._service = build('people', 'v1', credentials=notification.data.credentials, http=Http(timeout=10), cache_discovery=False) # todo: what's the best fix for cache?
self.sync_contacts() # sync_contacts is always scheduled in order to not queue posting notifications until after sync_contacts finishes, when called from a notification handler except Exception as e:
log.error('Error fetching Google contacts: %s' % str(e))
else:
self.active = True
self.sync_contacts() # sync_contacts is always scheduled in order to not queue posting notifications until after sync_contacts finishes, when called from a notification handler
def _NH_GoogleAuthorizationWasRejected(self, notification): def _NH_GoogleAuthorizationWasRejected(self, notification):
self._service = None self._service = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment