Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#5889 closed (wontfix)

handler500 example to documentation

Reported by: mikko@… Owned by: nobody
Component: Documentation Version: dev
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

Description

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@…> 16 years ago.
Patch against Django trunk root

Download all attachments as: .zip

Change History (5)

by Mikko Ohtamaa <mikko@…>, 16 years ago

Attachment: handler500_example.patch added

Patch against Django trunk root

comment:1 by Mikko Ohtamaa <mikko@…>, 16 years ago

Has patch: set

comment:2 by James Bennett, 16 years ago

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 by Mikko Ohtamaa <mikko@…>, 16 years ago

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 by Mikko Ohtamaa <mikko@…>, 16 years ago

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