Opened 19 years ago
Closed 18 years ago
#2004 closed enhancement (fixed)
[patch] send_project_index() as exception handler in modpython_frontend.py
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.10.4 |
Component: | web frontend/mod_python | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Currenly, when get_environment() would cause an exception (if the environment isn't read+write for the webserver, for example), the modpython_frontend would just bounce the exception all the way up, creating a generic "500 internal server error" on screen, requiring the user to go read the Apache error_log for ideas why. This trivial patch catches those exceptions and handles them a little more gracefully, calling send_project_index().
Attachments (2)
Change History (7)
by , 19 years ago
Attachment: | trac_prj_index_on_exception.patch added |
---|
comment:1 by , 19 years ago
Milestone: | 0.9 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Type: | defect → enhancement |
If there's an error opening the environment then it's expected to report this as an error. I think it will be more confusing to simply kick people out to the project index than to show them that the project isn't accessible since there was an error opening it.
I guess it may be possible to display a nicer page that shows the error and a listing of other projects. However, the submitted patch doesn't look like it would handle displaying the project index under normal (non-exception) circumstances. We should also still use a "500" response in the case of an error and log the full error for debugging purposes.
I'm reclassifying this as an enhancement since I think that the current behavior is acceptable, but we could present things a little nicer.
comment:2 by , 19 years ago
If there's an error opening the environment then it's expected to report this as an error.
Agreed. And it does, but only in Apache's error_log which some people (like in shared hosting environments) don't necessarily have access to. It would be better to at least see the reason for the error in the browser. I'm attaching a second patch which may fit your description better.
by , 19 years ago
Attachment: | trac_prj_index_on_exception2.patch added |
---|
comment:4 by , 18 years ago
Keywords: | review removed |
---|---|
Milestone: | → 0.10.4 |
Owner: | changed from | to
Status: | assigned → new |
Catching environment errors has been implemented recently.
trivial patch to handle exceptions better