Applied HTTP.pm patch from Andy Grundman <andy@hybridized.org>. Fixed debug log on...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 861d5ef..ab305ec 100644 (file)
@@ -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 ] ];
             }