Commit a375531c by Rabia Iftikhar Committed by GitHub

Merge pull request #16120 from edx/ri/EDUCATOR-139-add-log

EDUCATOR-139 add log to identify the cause of error
parents 7b2f7214 ec105008
...@@ -881,7 +881,21 @@ class XModule(HTMLSnippet, XModuleMixin): ...@@ -881,7 +881,21 @@ class XModule(HTMLSnippet, XModuleMixin):
request_post[key] = map(FileObjForWebobFiles, request.POST.getall(key)) request_post[key] = map(FileObjForWebobFiles, request.POST.getall(key))
response_data = self.handle_ajax(suffix, request_post) response_data = self.handle_ajax(suffix, request_post)
try:
return Response(response_data, content_type='application/json') return Response(response_data, content_type='application/json')
except TypeError:
request_environ = getattr(request, 'environ')
log.exception(
'Response creation failed for problem url: %s, response_data type: %s, LANG: %s, '
'LC_ALL: %s and HTTP_ACCEPT_ENCODING: %s',
request_environ.get('HTTP_REFERER'),
type(response_data),
request_environ.get('LANG'),
request_environ.get('LC_ALL'),
request_environ.get('HTTP_ACCEPT_ENCODING')
)
raise
def get_child(self, usage_id): def get_child(self, usage_id):
if usage_id in self._child_cache: if usage_id in self._child_cache:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment