From: Sebastian Riedel Date: Mon, 4 Apr 2005 19:56:50 +0000 (+0000) Subject: fixed Local in MyApp.pm X-Git-Tag: 5.7099_04~1596 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=384698dea9ef30285e41558de0fc62a24da1e4ee fixed Local in MyApp.pm --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 21cf434..d09d2d9 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -121,13 +121,11 @@ sub dispatch { $c->state(1); if ( my $begin = @{ $c->get_action( 'begin', $namespace ) }[-1] ) { $c->execute( @{ $begin->[0] } ); - return if scalar @{$c->error}; } # Execute the auto chain for my $auto ( @{ $c->get_action( 'auto', $namespace ) } ) { $c->execute( @{ $auto->[0] } ); - return if scalar @{$c->error}; last unless $c->state; } @@ -141,7 +139,6 @@ sub dispatch { # Execute last end if ( my $end = @{ $c->get_action( 'end', $namespace ) }[-1] ) { $c->execute( @{ $end->[0] } ); - return if scalar @{$c->error}; } } else { @@ -203,14 +200,10 @@ sub execute { else { $c->state( &$code( $class, $c, @{ $c->req->args } ) ) } }; if ( my $error = $@ ) { - - unless ( ref $error ) { - chomp $error; - $error = qq/Caught exception "$error"/; - } - + chomp $error; + $error = qq/Caught exception "$error"/; $c->log->error($error); - $c->error($error); + $c->error($error) if $c->debug; $c->state(0); } return $c->state; @@ -794,7 +787,7 @@ sub set_action { $absolute = 1; } $absolute = 1 if $flags{global}; - my $name = $absolute ? $path : "$prefix/$path"; + my $name = $absolute ? $path : $prefix ? "$prefix/$path" : $path; $c->actions->{plain}->{$name} = [ $namespace, $code ]; } if ( my $regex = $flags{regex} ) {