nhsengland / ckanext-nhsengland

NHS England CKAN skin
GNU Affero General Public License v3.0
2 stars 5 forks source link

Error message when datapusher fails visible to user #13

Open rossjones opened 9 years ago

rossjones commented 9 years ago

When datapusher fails, it shows a stacktrace to the end-user (admin) in the resource datastore tab .. for instance

Error:
[u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/apscheduler/scheduler.py", line 512,  in _run_job\n retval = job.func(*job.args, **job.kwargs)\n', 
u' File "/usr/lib/ckan/datapusher/src/datapusher/datapusher/jobs.py", line 226, in push_to_datastore\n resource = get_resource(resource_id, ckan_url, api_key)\n', 
u' File "/usr/lib/ckan/datapusher/src/datapusher/datapusher/jobs.py", line 182, in get_resource\n \'Authorization\': api_key}\n', u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/requests/api.py", line 94, in post\n return request(\'post\', url, data=data, json=json, **kwargs)\n', 
u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/requests/api.py", line 49, in request\n return session.request(method=method, url=url, **kwargs)\n', 
u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/requests/sessions.py", line 457, in request\n resp = self.send(prep, **send_kwargs)\n', 
u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/requests/sessions.py", line 569, in send\n r = adapter.send(request, **kwargs)\n', 
u' File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/requests/adapters.py", line 407, in send\n raise ConnectionError(err, request=request)\n', u"ConnectionError(ProtocolError('Connection aborted.', error(110, 'Connection timed out')),)"]

This probably isn't much use to the end-user, we should change it to show a more useful error message.

ntoll commented 9 years ago

+1 - but we should also make sure it is logged somewhere obvious for further investigation.