[Catalyst] Error handling

Tomas Doran bobtfish at bobtfish.net
Mon Jan 18 17:22:09 GMT 2010


Steve Kleiman wrote:
> Found a post on this mailing list suggesting:
> 
> sub finalize_error {
>   my ($c) = @_; # Note, not ($self, $c)
> 
>   if ( @{$c->errors} ) {
>     $c->stash->template('error.tt');
>     # You might also need to forward to the view here yourself
>     return;
>   }
>   $c->NEXT::finalize_error();
> }
> 
> But the error seems to abort all processing and never make it to this point.

I don't see why that's happening - can you explain what you mean by 
'abort all processing'?

The most common reason for custom error handlers not working is that 
people forget to call $c->clear_error...

Cheers
t0m




More information about the Catalyst mailing list