On Mar 17, 2008, at 1:15 AM, Dami Laurent (PJ) wrote:
So I think something more radical is needed, at the core of the chained
actions mechanism. I tried the following modification to
Catalyst::ActionChain

   sub dispatch {
       my ( $self, $c ) = @_;
       my @captures = @{$c->req->captures||[]};
       my @chain = @{ $self->chain };
       my $last = pop(@chain);
       foreach my $action ( @chain ) {
           my @args;
           if (my $cap = $action->attributes->{CaptureArgs}) {
             @args = splice(@captures, 0, $cap->[0]);
           }
           local $c->request->{arguments} = [EMAIL PROTECTED];
           $action->dispatch( $c );

           # ADDED LINE HERE
           return if $c->error;

       }
       $last->dispatch( $c );
   }

and it seems to work fine. However, I don't know if this would create
undesirable side-effects, nor if the modification above should become
default, or something that would be toggled by a global Catalyst option.


I like this idea. I've never personally needed to see three errors
when the first is usually what causes the next two anyway. Since this
would be new behavior, though, it would have to be opt-in, as you
suggest, toggled by an application configuration value.


-Ashley

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to