my $begin = ( $c->get_actions( 'begin', $c->namespace ) )[-1];
return 1 unless $begin;
$begin->dispatch( $c );
- return !@{ $c->error };
+ #If there is an error, all bets off
+ if( @{ $c->error }) {
+ return !@{ $c->error };
+ } else {
+ return $c->state || 1;
+ }
}
sub _AUTO : Private {
$auto->dispatch( $c );
return 0 unless $c->state;
}
- return 1;
+ return $c->state || 1;
}
sub _ACTION : Private {
{
$c->action->dispatch( $c );
}
- return !@{ $c->error };
+ #If there is an error, all bets off
+ if( @{ $c->error }) {
+ return !@{ $c->error };
+ } else {
+ return $c->state || 1;
+ }
}
sub _END : Private {
# Parse out :Foo(bar) into Foo => bar etc (and arrayify)
- if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)\s*\))?$/ ) )
+ if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)?\s*\))?$/ ) )
{
if ( defined $value ) {