Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix exceptions in wrapped rest_framework exception handler #335

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Apr 22, 2020

  • The request data is not guaranteed to be available in the exception handler, so this wraps the assignment to safely access the data.

  • The import path could still result in a call to None, this changes the handler to detect None and raise either a django ImproperlyConfigured or RuntimeError depending what is available.

Fixes: #314

- The request data is not guaranteed to be available in the exception
  handler, so this wraps the assignment to safely access the data.

- The import path could still result in a call to ``None``, this changes
  the handler to detect ``None`` and raise either a django
  ImproperlyConfigured or RuntimeError depending what is available.
@waltjones waltjones merged commit 3ad499c into rollbar:master Aug 17, 2020
@terencehonles terencehonles deleted the fix-django-rest-framework-exception-handler branch August 18, 2020 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

django-rest-framework: UnsupportedMediaType crashes post_exception_handler
2 participants