Edgewall Software
Modify

Opened 19 years ago

Closed 17 years ago

#2004 closed enhancement (fixed)

[patch] send_project_index() as exception handler in modpython_frontend.py

Reported by: dmbrucker@… 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)

trac_prj_index_on_exception.patch (632 bytes ) - added by dmbrucker@… 19 years ago.
trivial patch to handle exceptions better
trac_prj_index_on_exception2.patch (700 bytes ) - added by dmbrucker@… 19 years ago.

Download all attachments as: .zip

Change History (7)

by dmbrucker@…, 19 years ago

trivial patch to handle exceptions better

comment:1 by Matthew Good, 19 years ago

Milestone: 0.9
Owner: changed from Christopher Lenz to Matthew Good
Status: newassigned
Type: defectenhancement

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 anonymous, 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 dmbrucker@…, 19 years ago

comment:3 by sid, 18 years ago

Keywords: review added

patch attached, adding review keyword

comment:4 by Christian Boos, 17 years ago

Keywords: review removed
Milestone: 0.10.4
Owner: changed from Matthew Good to Christian Boos
Status: assignednew

Catching environment errors has been implemented recently.

comment:5 by Christian Boos, 17 years ago

Resolution: fixed
Status: newclosed

Done in r5119.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.