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 ( my

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 (

[Catalyst] Trapping exceptions in Catalyst.pm

2010-08-02 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 for the