From: Marcus Ramberg Date: Tue, 6 Sep 2005 06:57:03 +0000 (+0000) Subject: added a comment, compacted a couple of elses. X-Git-Tag: 5.7099_04~1246 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=11bbf52f078354af4e107fdfa3d02045e77c9dcd added a comment, compacted a couple of elses. --- diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 9fc441e..3d43f9c 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -33,6 +33,7 @@ Like C but doesn't return. sub detach { my ( $c, $command, @args ) = @_; $c->forward( $command, @args ) if $command; + # die with DETACH signal, which will be caught in dispatching. die $Catalyst::Engine::DETACH; } @@ -92,9 +93,7 @@ sub dispatch { $c->execute( @{ $end->[0] } ); return if scalar @{ $c->error }; } - } - - else { + } else { my $path = $c->req->path; my $error = $path ? qq/Unknown resource "$path"/ @@ -166,9 +165,7 @@ qq/Couldn't forward to command "$command". Invalid action or component./; if ( my $code = $c->components->{$class}->can($method) ) { $c->actions->{reverse}->{"$code"} = "$class->$method"; $results = [ [ [ $class, $code ] ] ]; - } - - else { + } else { my $error = qq/Couldn't forward to "$class". Does not implement "$method"/; $c->error($error);