Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5889 closed (wontfix)

handler500 example to documentation

Reported by: mikko@… Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: handler500
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Here is an example how to use handler500 to log an exception. Goes against request-response.txt

Attachments (1)

handler500_example.patch (1.4 KB) - added by Mikko Ohtamaa <mikko@…> 11 years ago.
Patch against Django trunk root

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Mikko Ohtamaa <mikko@…>

Attachment: handler500_example.patch added

Patch against Django trunk root

comment:1 Changed 11 years ago by Mikko Ohtamaa <mikko@…>

Has patch: set

comment:2 Changed 11 years ago by James Bennett

Resolution: wontfix
Status: newclosed

I'm inclined to wontfix this, just because custom recovery from internal errors is something that people probably shouldn't be trying to do unless they already know how to.

comment:3 Changed 11 years ago by Mikko Ohtamaa <mikko@…>

Hello ubernostrum,

The point of this patch is not custom recovery, but custom logging. The documentation does point out how to handle 500 errors (show internal server error page) page, but it does not tell how to know which error there was and how to report it to the site administration.

"unless they already know how to"

The exception information is not straighforward to obtain, since the exception is not given as a parameter for the 500 handler. How people will ever know how to access this information if it's not documented somewhere?

I beg you to reconsider this ticket based on these clarifications.

comment:4 Changed 11 years ago by Mikko Ohtamaa <mikko@…>

How about just adding this sentence:

"If you want to access the exception in your handler500() function, you can use function sys.exc_info() to get the orignal exception."

exception = sys.exc_info()[0]

Note: See TracTickets for help on using tickets.
Back to Top