Egg::Plugin::ErrorDocument - Plugin that generates error screen.


  use Egg qw/ ErrorDocument /;
    plugin_error_document => {
      view_name => 'Template',
      template  => 'error.tmpl',
      include_ignore_status => 403,


It is a plugin to generate the error screens such as '404 Not Found' and '500 Server Error'.

The WEB server doesn't generate the error screen only with the return of the status code such as 404 when operating excluding the mod_perl environment. This plugin supplements it. Of course, it is possible to use it even in the mod_perl environment.

The error screen that this plugin intervenes is an error screen when processing can be normally completed. The error screen concerning the exception becomes the debugging screen of Egg.

The error screen is made by set arbitrary VIEW.

To acquire the status code easily on the VIEW side, following parameter is set.


Especially, being able to do only the condition judgment by the presence of the value in HTML::Template can correspond by doing as follows.

  <TMPL_IF NAME="status_404">
    ... 404 Not Found.
  <TMPL_IF NAME="status_403">
    ... 403 Forbidden.
    ... 500 Internal Server Error.


view_name => [VIEW_NAME]

VIEW to make the error screen is specified.

  view_name => 'Mason',

* There is no default. When it is unspecification, the exception is generated.

template => [TEMPLATE]

The template of the error screen is specified.

It is a template for VIEW specified by 'View_name' and it is necessary to exist.

  template => 'document/',

ignore_status => [STATUS_ARRAY],

The list of the status code of off the subject is specified.

Default is 200, 301, 302, 303, 304, 307,

  ignore_status => [qw/ 200 301 302 303 304 307 403 /],

include_ignore_status => [STATUS_ARRAY],

List of status code added to 'ignore_status'.

  include_ignore_status => 403,


Egg::View, Egg::View::Mason, Egg::View::Template, Egg::Release,


Masatoshi Mizuno <>


Copyright (C) 2007 by Bee Flag, Corp. <>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.