X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=d64b17eb4bf237df340391e403f93beca23f8c7d;hp=46f41f8fb629637486b2892a731fcd2f770dbd15;hb=cc7af07896de5c87baac6769907537038683ebe7;hpb=33e9a6a9fabf0f99bcfc0161dcdefd4e5de2998a diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 46f41f8..d64b17e 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -239,7 +239,7 @@ Documented in L sub forward { my $self = shift; no warnings 'recursion'; - $self->_do_forward(forward => @_); + return $self->_do_forward(forward => @_); } sub _do_forward { @@ -261,6 +261,12 @@ sub _do_forward { no warnings 'recursion'; $action->dispatch( $c ); + #If there is an error, all bets off regarding state. Documentation + #Specifies that when you forward, if there's an error you must expect + #state to be 0. + if( @{ $c->error }) { + $c->state(0); + } return $c->state; }