From: Sebastian Riedel Date: Thu, 16 Sep 2004 10:33:00 +0000 (+0000) Subject: exceptions for authenticate X-Git-Tag: 2.10~178 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=4ab33d12a514e0531e16f3d2812b15258de258c5;p=maypole.git exceptions for authenticate git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@184 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 4a5a8e7..11fbe52 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -78,7 +78,15 @@ sub handler_guts { } # We authenticate every request, needed for proper session management - my $status = $r->call_authenticate; + my $status; + eval { $status = $r->call_authenticate }; + if ( my $error = $@ ) { + $status = $r->call_exception($error); + if ( $status != OK ) { + warn "caught model error: $error"; + return $r->debug ? $r->view_object->error( $r, $error ) : ERROR; + } + } if ( $r->debug and $status != OK and $status != DECLINED ) { $r->view_object->error( $r, "Got unexpected status $status from calling authentication" );