#30858: Ambiguous phrasing in the Error Reporting documentation
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  ForgottenLords                     |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  master
  Documentation                      |       Keywords:  Error Reporting,
               Severity:  Normal     |  Documentation
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In the [https://docs.djangoproject.com/en/2.2/howto/error-reporting/ Error
 Reporting] documentation, the following phrasing is used (Emphasis Mine):

 ''When DEBUG is False, Django will email the users listed in the ADMINS
 setting **whenever your code raises an unhandled exception and results in
 an internal server error** (HTTP status code 500)''

 Myself and several others in my development team read this as:
 ''Whenever your code raises an unhandled exception resulting in an
 internal server error''

 when in actuality it should read more like the following to better reflect
 the correct behavior of Django:
 ''Whenever your code raises an unhandled exception, or your view returns a
 response with a status code 500''

 The nuance is perhaps small, but we had been operating under the
 assumption that views returning a response with status_code=500 would be
 'silent' and not generate emails as they are internal server errors, but
 have already been correctly and safely handled by our code but we still
 want to send the client a 500 to inform them that the response could not
 be completed as expected.  We assumed based on that line that emails would
 ONLY be sent as a result of unhandled exceptions.

 It may be worth expanding on the error handling to allow users to return
 'safe' 500 responses that will not be logged, and in fact Django does
 check for the _has_been_logged property already before logging the
 response, which we can set in our code already so perhaps just exposing
 that to the documentation in a little note would be useful to people who
 want to send 500 responses without sending emails might be sufficient.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30858>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.eacd7867bd949e2164f1aeabe6227d89%40djangoproject.com.

Reply via email to