#5889 closed (wontfix)
handler500 example to documentation
Reported by: | 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)
Change History (5)
by , 17 years ago
Attachment: | handler500_example.patch added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|
comment:2 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 , 17 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 , 17 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]
Patch against Django trunk root