[Catalyst] exception handling?

Caroline Johnston johnston at biochemistry.ucl.ac.uk
Tue Nov 15 17:41:29 CET 2005


Sorry - my bad. MyApp::end really wasn't getting called cos I had an auto
in my MyApp like:

sub auto : Private {
    my ( $self, $c ) = @_;
    $c->forward('/login/login')
	unless ($c->session->{user} || $c->req->action =~ /login/);
 }

the unless was failing - should have been ->path not ->action (I
think) and I had my login controller setting an error. So there was always
an error after auto, and it jumped straight out to finalize.

Thanks anyway!

Cxx

On Tue, 15 Nov 2005, Sebastian Riedel wrote:

>
> 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
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>




More information about the Catalyst mailing list