X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=11fbe52791014fda2e9c0cb6af9abbf187fd1748;hb=4ab33d12a514e0531e16f3d2812b15258de258c5;hp=4a5a8e79cb82a5a982b150c0c599cf15a2ed74ed;hpb=4b37444fc8ad176ede57c571eff0e6aefd712d0e;p=maypole.git 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" );