[Catalyst] exception handling?

Sebastian Riedel sri at oook.de
Tue Nov 15 15:56:41 CET 2005


Am 15.11.2005 um 14:49 schrieb Caroline Johnston:

> Thanks for getting back to me. I was really looking for a guide to  
> how the
> error processing works rather than an example of how to use it. I'm
> probably just being gormless, but I can't seem to get the example  
> to work.
>
> Clearing the error in MyApp::end doesn't seem to make any  
> difference. In
> fact, doing anything in end doesn't seem to make a difference if  
> I've set
> an error.
>
> If in end I have:
>
>     if ( 1 ) {
>             $c->stash->{errors}   = $c->error;
>             $c->stash->{template} = 'errors';
>             $c->forward('WebR::View::TT');
>             $c->{error} = [];
>         }

sub end : Private {
     my ( $self, $c ) = @_;

     if ( @{ $c->error } ) {
         $c->stash->{errors}   = $c->error;
         $c->stash->{template} = 'error.tt';
     }

     $c->forward('View::TT');

     $c->error(0);
}


--
sebastian




More information about the Catalyst mailing list