Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 91877 invoked from network); 12 Sep 2008 22:39:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 22:39:21 -0000 Received: (qmail 53572 invoked by uid 500); 12 Sep 2008 22:39:13 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 53545 invoked by uid 500); 12 Sep 2008 22:39:13 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 53534 invoked by uid 99); 12 Sep 2008 22:39:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 15:39:13 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 22:38:14 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KeHHo-0007RL-Su for modperl@perl.apache.org; Fri, 12 Sep 2008 15:38:44 -0700 Message-ID: <19465331.post@talk.nabble.com> Date: Fri, 12 Sep 2008 15:38:44 -0700 (PDT) From: kropotkin To: modperl@perl.apache.org Subject: Re: die problem in mod_perl In-Reply-To: <66887a3d0809121420q2eef7769n53ea3d04d48fd869@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: enquiries@mms-oxford.com References: <19462854.post@talk.nabble.com> <66887a3d0809121320p88374e5l26123a2f73303f9d@mail.gmail.com> <19464258.post@talk.nabble.com> <66887a3d0809121420q2eef7769n53ea3d04d48fd869@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Perrin Thanks again. This is most helpful. I've now wrapped the top level call in an eval block and that works fine. Just one problem though - print STDERR is printing the message to the main server error log not the virtual host error log. die printed it to the virtual host error log. It doesn't really matter as only I not clients will be looking at the log but it is a frustration. regards Kropotkin Perrin Harkins wrote: > > On Fri, Sep 12, 2008 at 5:14 PM, kropotkin > wrote: >> True; I could pass return values >> back up the chain and at the top-level if there was a problem do return >> "OK" >> there to cancel execution without generating a 500 error but this would >> be a >> pain to manage. > > Then catch the die in an eval at a level where you can return OK to > apache. > >> I found an easier solution - which may of course not be the 'best' one: I >> still call die in my custom error handling routine which generates a 500 >> error. But I've used the Apache ErrorDocument directive to kill of the >> default error message and replace it with my own (I found out it takes >> text >> as well as a file). I just pass it a period, and that's it. > > That's not a good solution. What if there was an unexpected error in > some other code? You would never know. > > - Perrin > > -- View this message in context: http://www.nabble.com/die-problem-in-mod_perl-tp19462854p19465331.html Sent from the mod_perl - General mailing list archive at Nabble.com.