Skip to content

Commit f0163f2

Browse files
authored
check db error message for no access (#72)
1 parent 62ebf16 commit f0163f2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stormdb/access.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ def _check_response(self, response, error_str='error'):
154154
msg = ('Invalid username or wrong password!')
155155
elif response.find('The project does not exist') != -1:
156156
msg = ('The project ID/code used ({0}) '
157-
'does not exist in the database, please '
158-
'check.'.format(self.proj_name))
157+
'does not exist in the database'
158+
'.'.format(self.proj_name))
159+
elif response.find('You are not allowed to view this '
160+
'project') != -1:
161+
msg = ("You do not have access to the project "
162+
"'{0}'".format(self.proj_name))
159163
else:
160164
msg = ('StormDB reports error "{0}", not sure what to do '
161165
'about it.'.format(response))
@@ -307,7 +311,7 @@ def get_subject_info(self, subj_id):
307311
subj_id : str
308312
A string uniquely identifying a subject in the database.
309313
For example: '0001_ABC'
310-
314+
311315
Returns
312316
-------
313317
info_dict : dict

0 commit comments

Comments
 (0)