From: Marcus Ramberg Date: Mon, 20 Sep 2004 23:13:45 +0000 (+0000) Subject: warn only with debug on. X-Git-Tag: 2.10~160 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=bd977b8f654533448f37b0dca135003d997c0190 warn only with debug on. set encoding & charset before processing view get encoding from application in header. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@202 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole.pm b/lib/Maypole.pm index d0ba118..cce6cd7 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -1,5 +1,5 @@ package Maypole; -use base qw(Class::Accessor::FAST Class::Data::Inheritable); +use base qw(Class::Accessor::Fast Class::Data::Inheritable); use attributes (); use UNIVERSAL::require; use strict; @@ -111,7 +111,7 @@ sub handler_guts { if ( my $error = $@ ) { $status = $r->call_exception($error); if ( $status != OK ) { - warn "caught view error: $error"; + warn "caught view error: $error" if $r->debug; return $r->debug ? $r->view_object->error( $r, $error ) : ERROR; } } diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index fdc6629..b577364 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -61,10 +61,10 @@ sub vars { sub process { my ( $self, $r ) = @_; - my $status = $self->template($r); - return $self->error($r) if $status != OK; $r->{content_type} ||= "text/html"; $r->{document_encoding} ||= "utf-8"; + my $status = $self->template($r); + return $self->error($r) if $status != OK; return OK; } diff --git a/templates/factory/header b/templates/factory/header index 8712c85..148cc94 100644 --- a/templates/factory/header +++ b/templates/factory/header @@ -8,7 +8,9 @@ "A poorly configured Maypole application" %] - +