mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 05:00:07 -03:30
Major rename of package from lib to ansibleworks.
This commit is contained in:
12
ansibleworks/middleware/exceptions.py
Normal file
12
ansibleworks/middleware/exceptions.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import traceback
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user