Handling more cases of login/credentials issues

This commit is contained in:
Sybren A. Stüvel 2016-05-18 13:01:04 +02:00
parent ba4c951d32
commit be46b9cf81
2 changed files with 7 additions and 3 deletions

View File

@ -348,7 +348,7 @@ class BlenderCloudBrowser(bpy.types.Operator):
self._show_subscribe_screen() self._show_subscribe_screen()
return return
except pillar.UserNotLoggedInError: except pillar.UserNotLoggedInError:
self.error('User not logged in on Blender ID.') self.log.error('User not logged in on Blender ID.')
else: else:
self.log.info('Credentials refreshed and ok, browsing assets.') self.log.info('Credentials refreshed and ok, browsing assets.')
await self.async_download_previews() await self.async_download_previews()

View File

@ -179,7 +179,7 @@ async def check_pillar_credentials():
try: try:
db_user = await pillar_call(pillarsdk.User.find, pillar_user_id) db_user = await pillar_call(pillarsdk.User.find, pillar_user_id)
except pillarsdk.UnauthorizedAccess: except (pillarsdk.UnauthorizedAccess, pillarsdk.ResourceNotFound):
raise CredentialsNotSyncedError() raise CredentialsNotSyncedError()
roles = db_user.roles roles = db_user.roles
@ -208,7 +208,11 @@ async def refresh_pillar_credentials():
# Create a subclient token and send it to Pillar. # Create a subclient token and send it to Pillar.
# May raise a blender_id.BlenderIdCommError # May raise a blender_id.BlenderIdCommError
try:
blender_id.create_subclient_token(SUBCLIENT_ID, pillar_endpoint) blender_id.create_subclient_token(SUBCLIENT_ID, pillar_endpoint)
except blender_id.communication.BlenderIdCommError as ex:
log.warning("Unable to create authentication token: %s", ex)
raise CredentialsNotSyncedError()
# Test the new URL # Test the new URL
_pillar_api = None _pillar_api = None