Better reporting when the user is not logged in.

This commit is contained in:
2016-04-01 14:11:30 +02:00
parent 1bb32033b6
commit 5396fd765d
2 changed files with 12 additions and 1 deletions

View File

@@ -566,7 +566,15 @@ class BlenderCloudBrowser(bpy.types.Operator):
bgl.glRectf(0, 0, content_width, content_height)
font_id = 0
text = "An error occurred:\n%s" % self.async_task.exception()
ex = self.async_task.exception()
if isinstance(ex, pillar.UserNotLoggedInError):
ex_msg = 'You are not logged in on Blender ID. Please log in at User Preferences, ' \
'System, Blender ID.'
else:
ex_msg = str(ex)
if not ex_msg:
ex_msg = str(type(ex))
text = "An error occurred:\n%s" % ex_msg
lines = textwrap.wrap(text)
bgl.glColor4f(1.0, 1.0, 1.0, 1.0)