<%doc>
############################################################################
###    (C)opyright 2003 - 2008 RIPE NCC
###    This file is part of DNSMon
###
###    DNSMon is free software: you can redistribute it and/or modify
###    it under the terms of the GNU General Public License as published by
###    the Free Software Foundation, either version 3 of the License, or
###    (at your option) any later version.
###
###    DNSMon is distributed in the hope that it will be useful,
###    but WITHOUT ANY WARRANTY; without even the implied warranty of
###    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
###    GNU General Public License for more details.
###
###    You should have received a copy of the GNU General Public License
###    along with DNSMon.  If not, see <http://www.gnu.org/licenses/>.
############################################################################


  +-------------+
  | syshandler  |   produce no output. catch errors
  +-------------+
        |
        ^
        |
  +-------------+
  | autohandler |   produce HTML framework
  +-------------+
        |
        ^
        |
  +-------------+
  | base comp   |   URL requested content. e.g. /dns-servmon/news
  +-------------+

</%doc>
<%once>
</%once>
<%init>

  eval { $m->call_next };

  if (my $e = $@) {
    die $e if $m->aborted;  # for redirects
    warn "ERROR: syshandler caught: $e";
    # unexpected error. report it. 
    # XXX wrap error_log in eval in case it blows up. 
    eval { $m->comp( '/lib/error_log', error => $e ); };
    $m->comp( '/lib/redirect', path => '/dns-servmon/error' );
  }
</%init>
<%flags>
  inherit => undef
</%flags>
