[Catalyst] exception handling?

Matt S Trout dbix-class at trout.me.uk
Tue Nov 15 19:25:53 CET 2005


On Tue, Nov 15, 2005 at 04:41:29PM +0000, Caroline Johnston wrote:
> 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.

Hmm. Against 5.5+, I'd suggest using

$c->forward('/login/login')
  unless ($c->session->{user} || $c->action eq '/login/login');

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list