From 4ab33d12a514e0531e16f3d2812b15258de258c5 Mon Sep 17 00:00:00 2001 From: Sebastian Riedel Date: Thu, 16 Sep 2004 10:33:00 +0000 Subject: [PATCH] exceptions for authenticate git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@184 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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" ); -- 2.39.2