mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
14 lines
459 B
Python
14 lines
459 B
Python
# Copyright (c) 2013 AnsibleWorks, Inc.
|
|
# All Rights Reserved.
|
|
|
|
import traceback
|
|
from django.http import HttpResponse
|
|
|
|
class ExceptionMiddleware(object):
|
|
|
|
def process_exception(self, request, exception):
|
|
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)
|