Apache-ErrorControl

 view release on metacpan or  search on metacpan

ErrorControl.pm  view on Meta::CPAN


B<requestor> - the requestor of the page either "user (hostname (ip))",
"user (ip)", "hostname (ip)" or "ip", depending if their ip resolves or not.
NB: unless you have "HostnameLookups On" in you httpd.conf you will never
see the users hostname.

  <TMPL_VAR NAME="requestor">

=item *

B<base_url> - the base url of the website, i.e. http://www.abc.com

  <TMPL_VAR NAME="base_url">

=item *

B<request_url> - the full request url including arguments, i.e.
http://www.abc.com/stuff/stuffed.cgi?abc=yes&no=yes

  <TMPL_VAR NAME="request_url">

=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
  </TMPL_IF>

=item *

B<error_notes> - the error-notes (C<$r-E<gt>prev()-E<gt>notes('error-notes')>,
see L<Apache>). this is more useful in say a staging environment that has
mod_perl applications. it is the error message, for mod_perl applications
it includes the complete error message but for normal cgi applications
it just includes 'premature end of script headers'.

  <TMPL_IF NAME="error_notes">
    <h2>Error Notes</h2>
    <pre>
    <TMPL_VAR NAME="error_notes">
    </pre>
  </TMPL_IF>

=item *

B<env_*> - all env_* params are available, see L<HTML::Template::Set>
for details.

  <TMPL_VAR NAME="env_server_name">

=back

=head1 OPTIMISATION

As the module loads L<HTML::Template::Set> with the B<cache> option all
templates are automatically cached. To further increase the performance you
should look at the documentation of L<HTML::Template> for instructions on how
to pre-load your templates under mod_perl. If you do not use this methodology
L<HTML::Template> will only cache your templates per apache child process and
upon using them (i.e. before you will notice the benefits of using cache each
apache child process needs to load each template).

=head1 CAVEATS

This module may be missing something that you feel it needs, it has
everything I have wanted though. If you want a feature added please email me
or send me a patch.

One thing to note is that if you go to your handler directly
(i.e. http://www.abc.com/error) the system will return I<FORBIDDEN>. this will
also happen if your I<error code> is ever 200 (I<OK>) (which it should never be
unless you are accessing the handler directly). If you are interested in
testing your templates see the B<TESTING> section.

=head1 BUGS

I am aware of no bugs - if you find one, just drop me an email and i'll
try and nut it out (or email a patch, that would be tops!).

=head1 SEE ALSO

L<HTML::Template::Set>, L<HTML::Template>, L<Apache>

=head1 AUTHOR

David J Radunz <dj@boxen.net>

=head1 LICENSE

Apache::ErrorControl : Apache Handler for Templating Apache Error Documents

Copyright (C) 2004 David J Radunz (dj@boxen.net)



( run in 0.694 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )