[mod_python] This is just friggin' weird...

Joshua Ginsberg listspam at flowtheory.net
Fri Jun 24 10:46:07 EDT 2005


It's a bit hacky, but perhaps the way to keep everybody happy is that 
if the error is SERVER_RETURN and the return code is < 400, the error 
page should not be called; however if the error is other than 
SERVER_RETURN or the http return code >= 400, the error page is 
invoked.

-jag

-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown.jpg
Type: image/jpeg
Size: 1984 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050624/ff20a631/unknown-0001.jpg
-------------- next part --------------

Joshua Ginsberg -- joshg at brainstorminternet.net
Brainstorm Internet Network Operations
970-247-1442 x131
On Jun 23, 2005, at 6:09 PM, Graham Dumpleton wrote:

> Joshua Ginsberg wrote ..
>> BTW, isn't it a bug if psp.redirect invokes the page specified by
>> psp.set_error_page?
>
> The code in question is:
>
>             try:
>                 exec code in global_scope
>                 req.flush()
>
>                 # the mere instantiation of a session changes it
>                 # (access time), so it *always* has to be saved
>                 if session is not None:
>                     session.save()
>             except:
>                 et, ev, etb = sys.exc_info()
>                 if psp.error_page:
>                     # run error page
>                     psp.error_page.run({"exception": (et, ev, etb)})
>                 else:
>                     raise et, ev, etb
>
>
> One might say that it would make more sense if the exception
> raised is apache.SERVER_RETURN that it should pass it back
> immediately and not call the error page, but then some people
> might want customised error pages for actual HTTP errors.
>
> Anyone else got any thoughts about it?
>
> Graham
>


More information about the Mod_python mailing list