sentry-python
sentry-python copied to clipboard
XML body in Django (DRF) is not stringified
Environment
I'm using sentry.io (SaaS) with
- sentry-sdk 1.1.0,
- Django 2.2
- djangorestframework 3.12.1
- djangorestframework-xml 2.0.0
Steps to Reproduce
- Add a simple endpoint
from rest_framework_xml.parsers import XMLParser
@api_view(["POST"])
@parser_classes((XMLParser,))
def handle_request(request):
raise Exception("error!")
- POST some valid XML to that endpoint, such as
<?xml version="1.0" encoding="UTF-8"?>
<root></root>
- Find the exception reported to Sentry on sentry.io
Expected Result
Sentry should show the actual Body of the request (the XML document).
Actual Result
The value of "Body" on Sentry page is "<xml.etree.ElementTree.ElementTree object at 0xSOMEADDRESS>"