From 645529bf35956cc9e68f157f0f0052acfef7b035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 24 Jun 2016 14:46:27 +0200 Subject: [PATCH] Sync: gracefully handle credential sync errors --- blender_cloud/settings_sync.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blender_cloud/settings_sync.py b/blender_cloud/settings_sync.py index 0a77197..fbb12af 100644 --- a/blender_cloud/settings_sync.py +++ b/blender_cloud/settings_sync.py @@ -355,6 +355,8 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin, try: self.user_id = await self.check_credentials(context) + log.debug('Found user ID: %s', self.user_id) + try: self.home_project_id = await get_home_project_id() except sdk_exceptions.ForbiddenAccess: @@ -388,6 +390,9 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin, 'REFRESH': self.action_refresh, }[action] await action_method(context) + except pillar.CredentialsNotSyncedError: + self.log.exception('Error checking/refreshing credentials.') + self.bss_report({'ERROR'}, 'Please log in on Blender ID first.') except Exception as ex: self.log.exception('Unexpected exception caught.') self.bss_report({'ERROR'}, 'Unexpected error: %s' % ex)