X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=23df2a1d7b8537664e3565a0d5206a61a915cb0d;hb=8c11318848e17f92027484614d393b6ebd365f7d;hp=2c397820a8b0c5640647beb18d2d846c10cac092;hpb=7f92deef6d24d2a7618ba679892189838fcb4dfd;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 2c39782..23df2a1 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -90,7 +90,7 @@ sub finalize_cookies { sub finalize_error { my ( $self, $c ) = @_; - $c->res->headers->content_type('text/html'); + $c->res->content_type('text/html; charset=utf-8'); my $name = $c->config->{name} || 'Catalyst Application'; my ( $title, $error, $infos ); @@ -99,10 +99,11 @@ sub finalize_error { # For pretty dumps local $Data::Dumper::Terse = 1; $error = join '', - map { '' . encode_entities($_) . '' } + map { '

' . encode_entities($_) . '

' } @{ $c->error }; $error ||= 'No output'; $title = $name = "$name on Catalyst $Catalyst::VERSION"; + $name = "

$name

"; # Don't show context in the dump delete $c->req->{_context}; @@ -118,13 +119,20 @@ sub finalize_error { my $res = encode_entities Dumper $c->res; my $stash = encode_entities Dumper $c->stash; - $infos = join( - "\n", "
", - map { - sprintf "%s
\n
%s
", $_->[0], - encode_entities( Dumper $_->[1] ) - } $c->dump_these - ); + my @infos; + my $i = 0; + for my $dump ( $c->dump_these ) { + my $name = $dump->[0]; + my $value = encode_entities( Dumper $dump->[1] ); + push @infos, sprintf <<"EOF", $name, $value; +

%s

+
+
%s
+
+EOF + $i++; + } + $infos = join "\n", @infos; } else { $title = $name; @@ -144,9 +152,26 @@ sub finalize_error { $name = ''; } $c->res->body( <<"" ); - + + + + $title +