"Fossies" - the Fresh Open Source Software Archive

Member "mod_perl-2.0.11/t/hooks/TestHooks/error.pm" (5 Oct 2019, 990 Bytes) of package /linux/www/apache_httpd_modules/mod_perl-2.0.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "error.pm": 2.0.8_vs_2.0.9.

    1 # please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
    2 package TestHooks::error;
    3 
    4 use strict;
    5 use warnings FATAL => 'all';
    6 
    7 use Apache::Test;
    8 
    9 use Apache2::RequestRec ();
   10 use Apache2::RequestIO ();
   11 
   12 use Apache2::Const -compile => 'OK';
   13 
   14 use APR::Table ();
   15 
   16 sub handler {
   17     my $r = shift;
   18     my $args = $r->args();
   19     if (defined($args) && $args ne '') {
   20         $r->notes->set('error-notes' => $args);
   21     }
   22     &bomb();
   23     Apache2::Const::OK;
   24 }
   25 
   26 sub fail {
   27     my $r = shift;
   28     $r->print('Error: '.$r->prev->notes->get('error-notes'));
   29     Apache2::Const::OK;
   30 }
   31 
   32 1;
   33 __DATA__
   34 <NoAutoConfig>
   35   <Location /TestHooks__error>
   36       SetHandler modperl
   37       PerlResponseHandler TestHooks::error
   38       ErrorDocument 500 /TestHooks__error__fail
   39   </Location>
   40   <Location /TestHooks__error__fail>
   41       SetHandler modperl
   42       PerlResponseHandler TestHooks::error::fail
   43   </Location>
   44 </NoAutoConfig>