fixed: User is logged out if a fatal error occurs

error reporting and debug cleanups
This commit is contained in:
Graham Knop 2008-07-25 04:03:30 +00:00
parent e37db64483
commit 315e47781e
4 changed files with 40 additions and 34 deletions

View file

@ -66,15 +66,14 @@ sub handler {
my $error = "";
my $matchUri = $request->uri;
my $gateway = $config->get("gateway");
$matchUri =~ s{^$gateway(.*)}{/$1};
$matchUri =~ s{^$gateway}{/};
my $gotMatch = 0;
foreach my $handler (@{$config->get("urlHandlers")}) {
WEBGUI_FATAL: foreach my $handler (@{$config->get("urlHandlers")}) {
my ($regex) = keys %{$handler};
if ($matchUri =~ m{$regex}i) {
my $output = eval { WebGUI::Pluggable::run($handler->{$regex}, "handler", [$request, $server, $config]) };
if ($@) {
$error = $@;
warn $@ if ($@ =~ "^fatal:");
last;
}
else {
@ -82,7 +81,7 @@ sub handler {
if ($output ne Apache2::Const::DECLINED) {
return $output;
}
}
}
}
}
return Apache2::Const::DECLINED if ($gotMatch);