On Thu, May 9, 2013 at 9:34 AM, Aristotle Pagaltzis <[email protected]>wrote:
> * Bill Moseley <[email protected]> [2013-05-09 15:30]: > > What's the reasoning that chained actions continue to run after an > > earlier exception? > > Seems like an accident of the design to me, borderline bug. > Agreed. Seems like something that could be easily overlooked. > > If like me you don’t like it, Catalyst::ActionRole::DetachOnDie > Oh, that's nice. Tricks for applying it globally? I went the monkey patch route. Shield your eyes: use Catalyst::ActionChain; sub Catalyst::ActionChain::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->number_of_captures) { @args = splice(@captures, 0, $cap); } local $c->request->{arguments} = \@args; $action->dispatch( $c ); * return if @{ $c->error }; # Patch* } $last->dispatch( $c ); } -- Bill Moseley [email protected]
_______________________________________________ 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/
