try:
    from django.core.exceptions import ImproperlyConfigured
except ImportError:
    RestFrameworkExceptionHandler = None
else:
    try:
        from rest_framework.views import exception_handler as RestFrameworkExceptionHandler
    except (ImportError, ImproperlyConfigured):
        RestFrameworkExceptionHandler = None

    del ImproperlyConfigured


def post_exception_handler(exc, context):
    # This is to be used with the Django REST Framework (DRF) as its
    # global exception handler.  It replaces the POST data of the Django
    # request with the parsed data from the DRF.  This is necessary
    # because we cannot read the request data/stream more than once.
    # This will allow us to see the parsed POST params in the rollbar
    # exception log.
    context['request']._request.POST = context['request'].data
    return RestFrameworkExceptionHandler(exc, context)

@@ -86,64 +86,50 @@
     
-RestFrameworkExceptionHandler = None%0Aelse:%0A    
+ImproperlyConfigured = RuntimeError%0A%0A
 try:%0A
-    
     
@@ -182,38 +182,26 @@
 dler as 
-RestFrameworkE
+_e
 xception
 Handler%0A
@@ -196,20 +196,17 @@
 tion
-H
+_h
 andler%0A
-    
 exce
@@ -253,34 +253,18 @@
     
-    RestFrameworkE
+_e
 xception
 Hand
@@ -255,25 +255,26 @@
   _exception
-H
+_h
 andler = Non
@@ -280,38 +280,8 @@
 ne%0A%0A
-    del ImproperlyConfigured%0A%0A
 %0Adef
@@ -689,16 +689,173 @@
 on log.%0A
+%0A    if _exception_handler is None:%0A        raise ImproperlyConfigured(%0A            'Could not import rest_framework.views.exception_handler')%0A%0A    try:%0A    
     cont
@@ -917,37 +917,61 @@
     
-return RestFrameworkE
+except Exception:%0A        pass%0A%0A    return _e
 xception
 Hand
@@ -970,9 +970,10 @@
 tion
-H
+_h
 andl

fix exceptions in wrapped rest_framework exception handler