Apache-ErrorControl
view release on metacpan or search on metacpan
ErrorControl.pm view on Meta::CPAN
unless (grep(/^\Q$webmaster_email\E$/, @email)) {
push(@email, $webmaster_email);
}
}
}
}
my $notes = ($r->prev()) ? $r->prev()->notes() : undef;
# set the current error_code's TMPL_IF on (if the TMPL_IF exists)
# i.e. <TMPL_IF NAME="404">
if (exists $params{$self->{error_code}}) {
$tmpl->param( $self->{error_code} => TRUE );
} elsif (exists $params{'unknown_error'}) {
$tmpl->param( unknown_error => TRUE );
}
# set the error_code TMPL_VAR
# i.e. <TMPL_VAR NAME="error_code"> (which is substituted with 404)
if (exists $params{error_code}) {
$tmpl->param( error_code => $self->{error_code} );
}
# set the error_note if its defined
if (exists $params{'error_notes'}
and $notes and exists $notes->{'error-notes'}) {
$tmpl->param( error_notes => $notes->{'error-notes'} );
}
# load the 'date_format' from the template if its set
ErrorControl.pm view on Meta::CPAN
SetHandler perl-script
PerlHandler Apache::ErrorControl
PerlSetVar TemplateDir /usr/local/apache/templates
</Location>
ErrorDocument 400 /error
ErrorDocument 401 /error
ErrorDocument 402 /error
ErrorDocument 403 /error
ErrorDocument 404 /error
ErrorDocument 500 /error
in your template (allerrors.tmpl):
<TMPL_SET NAME="webmaster_email">dj@boxen.net</TMPL_SET>
<HTML>
<HEAD>
<TITLE>Error <TMPL_VAR NAME="error_code"></TITLE>
</HEAD>
<BODY>
<TMPL_IF NAME="404">
<H1>Error 404: File Not Found</H1>
<HR><BR>
<p>The file you were looking for is not here, we must have
deleted it - or you just might be mentally retarded</p>
</TMPL_IF>
<TMPL_IF NAME="500">
<H1>Error 500: Internal Server Error</H1>
<HR><BR>
<p>We are currently experiencing problems with our server,
ErrorControl.pm view on Meta::CPAN
=item *
B<date> - the date/time of the error (format depending on the
B<DateFormat> / B<date_format>.
<TMPL_VAR NAME="date">
=item *
B<error_code> - the I<error code>, i.e. 404, 403, 500 etc
<TMPL_VAR NAME="error_code">
=item *
B<*error_code*> - the actual I<error code> itself is set as a param (if the
param exists). if there is no TMPL_IF or TMPL_VAR
defined for the I<error code> encountered the param B<unknown_error> is
turned on (obviously only if it too is defined).
personally I cant see why anyone would ever need B<unknown_error> but ive
added it here anyways.
<TMPL_IF NAME="404">
Error 404 - File Not Found
</TMPL_IF>
=item *
B<unknown_error> - if the B<*error_code*> is not defined as a TMPL_VAR or
TMPL_IF and there is a TMPL_IF / TMPL_VAR by the name of B<unknown_error> it is
set to TRUE (1). as mentioned above I cannot see why anyone would want this.
<TMPL_IF NAME="unknown_error">
Error <TMPL_VAR NAME="error_code"> - Unknown
name: Apache-ErrorControl
version: 1.026
version_from: ErrorControl.pm
installdirs: site
requires:
Apache::Constants: 1.09
Apache::File: 1.01
Apache::Request: 1.1
Class::Date:
HTML::Template::Set: 1.01
MIME::Entity: 5.404
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
Makefile.PL view on Meta::CPAN
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Apache::ErrorControl',
'VERSION_FROM' => 'ErrorControl.pm', # finds $VERSION
'PREREQ_PM' => {
HTML::Template::Set => 1.010,
Class::Date => 1.1.6,
Apache::File => 1.01,
Apache::Constants => 1.09,
Apache::Request => 1.1,
MIME::Entity => 5.404
}, # e.g., Module::Name => 1.1
);
( run in 0.738 second using v1.01-cache-2.11-cpan-39bf76dae61 )