X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/dc50b737f80c8bd09ac2fbbfa2cc06a04e9d8753..7bd555b62a7501d750d7989b75b46a40c5e7c1a3:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index c75249bac..cfffd78e2 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -63,10 +63,13 @@ use strict; my $standard_dbh; END { - if ($standard_dbh) { - $standard_dbh->disconnect(); - undef $standard_dbh; - } + disconnect_standard_dbh(); +} + +sub disconnect_standard_dbh { + return unless $standard_dbh; + $standard_dbh->disconnect(); + undef $standard_dbh; } sub _store_value { @@ -455,8 +458,8 @@ sub error { $self->show_generic_error($msg); } else { - - die "Error: $msg\n"; + print STDERR "Error: $msg\n"; + ::end_of_request(); } $main::lxdebug->leave_sub(); @@ -772,7 +775,7 @@ sub _prepare_html_template { my $info = "Developer information: templates/webpages/${file}.html is newer than the translation file locale/${language}/all.\n" . "Please re-run 'locales.pl' in 'locale/${language}'."; print(qq|
$info|); - die($info); + ::end_of_request(); } $file = "templates/webpages/${file}.html"; @@ -781,7 +784,7 @@ sub _prepare_html_template { my $info = "Web page template '${file}' not found.\n" . "Please re-run 'locales.pl' in 'locale/${language}'."; print(qq|
$info|); - die($info); + ::end_of_request(); } if ($self->{"DEBUG"}) { @@ -895,9 +898,11 @@ sub show_generic_error { $self->header(); print $self->parse_html_template("generic/error", $add_params); + print STDERR "Error: $error\n"; + $main::lxdebug->leave_sub(); - die("Error: $error\n"); + ::end_of_request(); } sub show_generic_information { @@ -917,7 +922,7 @@ sub show_generic_information { $main::lxdebug->leave_sub(); - die("Information: $text\n"); + ::end_of_request(); } # write Trigger JavaScript-Code ($qty = quantity of Triggers) @@ -975,7 +980,7 @@ sub redirect { if (!$self->{callback}) { $self->info($msg); - exit; + ::end_of_request(); } # my ($script, $argv) = split(/\?/, $self->{callback}, 2);