Thread error handling (8 answers)
Opened by esskar at 2005-02-21 23:42

format_c
 2005-02-22 00:26
#4462 #4462
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Ich mach das so:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/perl
use strict;
use warnings;
use lib qw(../modules);
use CGI::Carp qw/fatalsToBrowser warningsToBrowser set_message/;
use CGI;
use HTML::Template;
use MyCMS;

my $maintemplate = '../tmpl/main.html';

sub handle_error {
my $msg = shift;
my $tmpl = HTML::Template->new(filename => $maintemplate);
$tmpl->param(TITLE => 'Serverfehler');
$tmpl->param(INHALT => "<h2>Serverfehler</h2>

<p>Bitte Kontaktieren sie webmaster\@creedforever.com mit folgender Fehlermeldung:</p>
<tt>$msg</tt>");
print $tmpl->output();
}
set_message(\&handle_error);

...


Gruß Alex

View full thread error handling