Better reporting when the user is not logged in.

This commit is contained in:
Sybren A. Stüvel 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) bgl.glRectf(0, 0, content_width, content_height)
font_id = 0 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) lines = textwrap.wrap(text)
bgl.glColor4f(1.0, 1.0, 1.0, 1.0) bgl.glColor4f(1.0, 1.0, 1.0, 1.0)

View File

@ -27,6 +27,9 @@ class UserNotLoggedInError(RuntimeError):
This is basically for every interaction with Pillar. This is basically for every interaction with Pillar.
""" """
def __str__(self):
return 'UserNotLoggedInError'
class PillarError(RuntimeError): class PillarError(RuntimeError):
"""Raised when there is some issue with the communication with Pillar. """Raised when there is some issue with the communication with Pillar.