X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=ab305eca9ddc4c7d105cb1dce88a855a904fcbfa;hb=6d1ab9154b299ce3697ec69d4ffd10dda4c07c0e;hp=861d5ef4f9b9f38ace5d5bda957a3c078d614660;hpb=f05af9ba770db5ada00fc0fb593560f39cc6b817;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 861d5ef..ab305ec 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -137,7 +137,7 @@ sub forward { my $class = $command || ''; if ( $class =~ /[^\w\:]/ ) { - my $error = qq/Couldn't forward to "$class"/; + my $error = qq/"$class" is an invalid Class name/; $c->error($error); $c->log->debug($error) if $c->debug; return 0; @@ -151,7 +151,7 @@ sub forward { } else { - my $error = qq/Couldn't forward to "$class"/; + my $error = qq/Couldn't forward to "$class". Does not implement "$method"/; $c->error($error); $c->log->debug($error) if $c->debug; @@ -235,13 +235,7 @@ sub get_action { my $name = $c->actions->{compiled}->[$i]->[0]; my $regex = $c->actions->{compiled}->[$i]->[1]; - if ( $action =~ $regex ) { - my @snippets; - for my $i ( 1 .. 9 ) { - no strict 'refs'; - last unless ${$i}; - push @snippets, ${$i}; - } + if ( my @snippets = ( $action =~ $regex ) ) { return [ [ $c->actions->{regex}->{$name}, $name, \@snippets ] ]; }