X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=c881d554740fd9c7b1d08638edfb285ddf19b71e;hb=1565e158ff4a868e199a99b779e6669ca1d9c53c;hp=8936fab819a399f4e8e97c7e64d242d1ec85c83a;hpb=ea72fece19fee2a788a7e9cab6076392fdd674a0;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 8936fab..c881d55 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -108,6 +108,24 @@ is in debug mode, or a `please come back later` message otherwise. =cut +sub _dump_error_page_element { + my ($self, $i, $element) = @_; + my ($name, $val) = @{ $element }; + + # This is fugly, but the metaclass is _HUGE_ and demands waaay too much + # scrolling. Suggestions for more pleasant ways to do this welcome. + local $val->{'__MOP__'} = "Stringified: " + . $val->{'__MOP__'} if ref $val eq 'HASH' && exists $val->{'__MOP__'}; + + my $text = encode_entities( dump( $val )); + sprintf <<"EOF", $name, $text; +

%s

+
+
%s
+
+EOF +} + sub finalize_error { my ( $self, $c ) = @_; @@ -138,14 +156,7 @@ sub finalize_error { my @infos; my $i = 0; for my $dump ( $c->dump_these ) { - my $name = $dump->[0]; - my $value = encode_entities( dump( $dump->[1] )); - push @infos, sprintf <<"EOF", $name, $value; -

%s

-
-
%s
-
-EOF + push @infos, $self->_dump_error_page_element($i, $dump); $i++; } $infos = join "\n", @infos;