                  exc.auth_header = auth_header
              else:
                  exc.status_code = status.HTTP_403_FORBIDDEN
  
          response = self.settings.EXCEPTION_HANDLER(exc)
  
          if response is None:
              raise
  
          response.exception = True
 
</s> remove         def exception_handler(exc):
 </s> add         def exception_handler(exc, context=None):
            self.assertTrue('args' in context)
            self.assertTrue('kwargs' in context)
            self.assertTrue('request' in context)
            self.assertTrue('view' in context)
 </s> remove def exception_handler(exc):
 </s> add def exception_handler(exc, context=None):
        context = self.get_renderer_context()
        response = self.settings.EXCEPTION_HANDLER(exc, context)
                  exc.auth_header = auth_header
              else:
                  exc.status_code = status.HTTP_403_FORBIDDEN
  
        context = self.get_renderer_context()
        response = self.settings.EXCEPTION_HANDLER(exc, context)
  
          if response is None:
              raise
  
          response.exception = True
keep keep keep keep replace keep keep keep keep keep
 Add context to exception handler #2236

Same context as renderers which include: the view,
args, kwargs, and request.

This provides enough contextual information to the
exception handlers to handle errors better.

In a use case like #1671, a custom handler
would allow Sentry to log the request properly. 
rest_framework/views.py