You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in contrib/django/middleware.py has an issues related to how django handles errors:
When a view throws an exception, TraceExceptionMiddleware.process_exception gets called and will set the span.error = 1. This is an issue, because other middleware might handle the exception and turn it into a non-500 response (e.g. raise Http404 will be handled by django and turned into a 404 response, which should have span.error = 0).
Potential Fix
One way to fix this would be to set span.error in process_response depending on the response's status code. For example:
Hello @patforna ! because the PR has been merged, do you have a way to check if it's working properly? we're about to ship the 0.12.1 next week, but want to be sure that problem can be considered closed. Thank you very much!
The code in
contrib/django/middleware.py
has an issues related to how django handles errors:When a view throws an exception,
TraceExceptionMiddleware.process_exception
gets called and will set thespan.error = 1
. This is an issue, because other middleware might handle the exception and turn it into a non-500 response (e.g.raise Http404
will be handled by django and turned into a 404 response, which should havespan.error = 0
).Potential Fix
One way to fix this would be to set
span.error
inprocess_response
depending on the response's status code. For example:This issue is related to a similar issue which has been reported and fixed for flask in
0.10.1
(see Issue 390)The text was updated successfully, but these errors were encountered: