}
}
- if ( !$r->output )
- { # You might want to do it yourself
- eval { $status = $r->view_object->process($r) };
+ # unusual path - perhaps output has been set to an error message
+ return OK if $r->output;
+
+ # normal path - no output has been generated yet
+ return $r->__call_process_view;
+}
+
+sub __call_process_view
+{
+ my ($r) = @_;
+
+ my $status;
+
+ eval { $status = $r->view_object->process($r) };
+
+ if ( my $error = $@ )
+ {
+ $status = $r->call_exception($error);
- if ( my $error = $@ )
+ if ( $status != OK )
{
- $status = $r->call_exception($error);
-
- if ( $status != OK )
- {
- warn "caught view error: $error" if $r->debug;
- return $r->debug ? $r->view_object->error($r, $error) : ERROR;
- }
+ warn "caught view error: $error" if $r->debug;
+ return $r->debug ? $r->view_object->error($r, $error) : ERROR;
}
-
- return $status;
}
- return OK;
+ return $status;
}
sub __load_model