datawiser / qual2db

Python code for extracting data from the Qualtrics API and posting to a MySQL database
8 stars 8 forks source link

Return an informative error when API user permissions are inadequate #17

Open datawiser opened 7 years ago

datawiser commented 7 years ago

Survey "Discerning together, stage 2" wasn't fully shared with the configured API user (permissions were missing), so we got this failure; can we enhance to inform the user that they need to grant the user (csr@calvin.edu on our system) the proper permissions?

Removing Discerning together, stage 2 from MySQL... Retrieving Discerning together, stage 2 Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1542, in call return self.func(*args) File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\thegui.py", line 432, in removeEvent remove() File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\thegui.py", line 448, in remove s = getSurvey(surveyName) File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\thegui.py", line 224, in getSurvey return survey(each[0]) File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\survey.py", line 141, in init self.refresh() File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\survey.py", line 19, in refresh info = self.qualInterface.getInfo(self.qid,debug=debug) File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\qualInterface.py", line 82, in getInfo xml = self.request(qid,'getSurveyName',debug=debug) File "R:\CSR\Admin\Computing\Software\Qualtrics\qual2db\qual2db\qualInterface.py", line 44, in request url = response.geturl()+request.data AttributeError: 'str' object has no attribute 'geturl'