From: John Napiorkowski Date: Mon, 9 Jun 2014 20:21:55 +0000 (-0400) Subject: abort on error defaults to true X-Git-Tag: 5.90070~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f9bdcfacb19ab17ed0b889ed6366272d8bf166fc abort on error defaults to true --- diff --git a/Changes b/Changes index a34c649..27419ed 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ # This file documents the revision history for Perl extension Catalyst. 5.90069_002 + - 'abort_chain_on_error_fix' now defaults to true. If this behavior + causes you issues, you can explicitly turn it off by setting it to a + non true defined value (0 is a good option here). - When throwing an http style exception, make sure we properly flush the existing log and report other errors in the error stack. diff --git a/lib/Catalyst/ActionChain.pm b/lib/Catalyst/ActionChain.pm index ed2fb51..fc39f09 100644 --- a/lib/Catalyst/ActionChain.pm +++ b/lib/Catalyst/ActionChain.pm @@ -35,8 +35,13 @@ sub dispatch { local $c->request->{arguments} = \@args; $action->dispatch( $c ); - # break the chain if exception occurs in the middle of chain - return if (@{$c->error} && $c->config->{abort_chain_on_error_fix}); + # break the chain if exception occurs in the middle of chain. We + # check the global config flag 'abort_chain_on_error_fix', but this + # is now considered true by default, so unless someone explictly sets + # it to false we default it to true (if its not defined). + my $abort = defined($c->config->{abort_chain_on_error_fix}) ? + $c->config->{abort_chain_on_error_fix} : 1; + return if ($c->has_errors && $abort); } $last->dispatch( $c ); }