Added error handling views and templates, added setting to log request errors to a file.

This commit is contained in:
Chris Church
2013-05-28 14:11:19 -04:00
parent e61a966464
commit 40dd9b08be
12 changed files with 117 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ from django.http import HttpResponse
class ExceptionMiddleware(object):
def process_exception(self, request, exception):
# FIXME: Should only format plain text for API exceptions.
return HttpResponse(traceback.format_exc(exception), content_type="text/plain", status=500)
if request.path.startswith('/api/'):
# FIXME: For GA, we shouldn't provide this level of detail to the
# end user.
return HttpResponse(traceback.format_exc(exception), content_type="text/plain", status=500)