[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: 200 Response on die
From:       Clinton Gormley <clint () traveljury ! com>
Date:       2007-06-30 10:29:50
Message-ID: 1183199390.4692.36.camel () getafix ! traveljury ! com
[Download RAW message or body]

Hi Christian

Yes, it is intended behaviour.

Basically, by the time that your script dies, it is too late to send the
correct headers to indicate a server error.

What I do is keep all of my content in a single variable, and once
pretty much everything that could die has finished, I
$r->print($content) as the last action by my handler.

All the previous code is wrapped in an eval, so I can catch any die's
and send a custom error page instead of $content.

Also, have a read of these docs:
http://perl.apache.org/docs/2.0/user/coding/coding.html#Integration_with_Apache_Issues


Clint

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic