Re: [Catalyst] Trapping exceptions in Catalyst.pm

2010-08-04 Thread Tomas Doran
On 4 Aug 2010, at 10:06, Ton Voon wrote: In general, it's better to test the return value from eval directly instead of depend on $...@. Something like: my $has_exception; eval { $c->state( $code->execute( $class, $c, @{ $c->req->args } ) || 0 ); 1; } || $has_exception++; ... if ( $has_ex

Re: [Catalyst] Trapping exceptions in Catalyst.pm

2010-08-04 Thread Ton Voon
On 2 Aug 2010, at 07:49, Bill Moseley wrote: In execute() there's this code: eval { $c->state( $code->execute( $class, $c, @{ $c->req- >args } ) || 0 ) }; $c->_stats_finish_execute( $stats_info ) if $c->use_stats and $stats_info; my $last = pop( @{ $c->stack } ); if ( m

[Catalyst] Trapping exceptions in Catalyst.pm

2010-08-01 Thread Bill Moseley
In execute() there's this code: eval { $c->state( $code->execute( $class, $c, @{ $c->req->args } ) || 0 ) }; $c->_stats_finish_execute( $stats_info ) if $c->use_stats and $stats_info; my $last = pop( @{ $c->stack } ); if ( my $error = $@ ) { The problem is that it's possible fo