Wrap cache retrieval function for web access method

This commit is contained in:
2010-06-04 08:46:20 +01:00
parent 41d7a731e4
commit 99ff9d77f8

View File

@@ -28,7 +28,10 @@ def retrieve_xml(request):
if 'userID' in params and not 'service' in params:
return HttpResponse('No Service ID provided.')
cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False)
try:
cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False)
except:
return HttpResponseServerError
if cached_doc:
return HttpResponse(cached_doc.body, mimetype='text/xml')