call. Planning to move the call to handler(), after calling handler_guts(), but
that breaks tests at the moment.
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@383
48953598-375a-da11-a14b-
00016c27c3ee
- 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);
- $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;