+ $r->{path} =~ s{/$}{}; # De-absolutify
+ $r->template( $r->{path} );
+ }
+
+ # We authenticate every request, needed for proper session management
+ my $status = $r->call_authenticate;
+ if ( $r->debug and $status != OK and $status != DECLINED ) {
+ $r->view_object->error( $r,
+ "Got unexpected status $status from calling authentication" );
+ }
+ return $status unless $status == OK;
+
+ # We run additional_data for every request
+ $r->additional_data;
+ if ( $applicable == OK ) {
+ eval { $r->model_class->process($r) };
+ 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;
+ }
+ }