fixed Local in MyApp.pm
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index 5b3e3d5..d09d2d9 100644 (file)
@@ -121,8 +121,6 @@ sub dispatch {
         $c->state(1);
         if ( my $begin = @{ $c->get_action( 'begin', $namespace ) }[-1] ) {
             $c->execute( @{ $begin->[0] } );
-            return if scalar @{$c->error};
-            last unless $c->state;
         }
 
         # Execute the auto chain
@@ -141,8 +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};
-            last unless $c->state;            
         }
     }
     else {
@@ -207,7 +203,7 @@ sub execute {
         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;
@@ -791,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} ) {