abort on error defaults to true
John Napiorkowski [Mon, 9 Jun 2014 20:21:55 +0000 (16:21 -0400)]
Changes
lib/Catalyst/ActionChain.pm

diff --git a/Changes b/Changes
index a34c649..27419ed 100644 (file)
--- 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.
 
index ed2fb51..fc39f09 100644 (file)
@@ -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 );
 }