Hi All,
I've noticed that if my app dies in cgiapp_prerun then my error mode defined in setup isn't called.

Is there a reason for this? Is there a way to get error_mode to catch errors in cgiapp_prerun?


Sample module:-

package Test;

BEGIN {
   use FindBin qw ($RealBin $RealScript);
   use lib $FindBin::RealBin;
   chdir $RealBin;
   if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) {
open STDERR, '> iisError.log' || die "Can't write to $RealBin/issError.log: $!\n";
       binmode STDERR;
       #close STDERR;
   }#if
}#BEGIN


use base 'CGI::Application';
use strict;

sub setup {
   my $self = shift;
   $self->start_mode('test');
   $self->error_mode( 'error' );
   $self->run_modes(
       'test' => 'test',
   );
}#sub

sub teardown {
   my $self = shift;
}#sub

sub cgiapp_prerun {
   my $self = shift;
   die( "Death message" ); ## 500 error
}#sub


sub test {
   my $self = shift;
#    die( "Death message" ); ## works
   return "Test";
}#sub

sub error {
   my $self = shift;
   return "Error mode ran @_";
}


1;


#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to