--- trunk/lib/Frey/Web.pm 2008/11/18 00:55:23 392
+++ trunk/lib/Frey/Web.pm 2008/11/18 12:02:57 407
@@ -1,6 +1,8 @@
package Frey::Web;
use Moose::Role;
+#with 'Frey::Escape';
+
use Frey::Types;
use Continuity::Widget::DomNode;
@@ -124,15 +126,18 @@
my $status_line = '';
foreach my $part ( @{ $self->status } ) {
+ confess "part not hash ",dump( $part ) unless ref($part) eq 'HASH';
foreach my $name ( keys %$part ) {
my $content = $part->{$name};
if ( ref($content) ) {
- $content = '' . dump( $content ) . '
';
+ $content = '' . dump($content) . '
';
+ my $l = length($content);
+ $content = qq|$l bytes| if $l > 1024;
} else {
$content = qq|$content|;
}
warn "### part [$name] = ", length( $content ), " bytes" if $self->debug;
- $status_line .= qq|$name $content|;
+ $status_line .= qq|$name $content\n|;
}
}
@@ -160,11 +165,12 @@
}
sub error {
- my ( $self, $error ) = @_;
+ my $self = shift;
+ my $error = join(" ", @_);
my ($package, $filename, $line) = caller;
- $error .= " at $filename line $line";
+ $error .= " at $filename line $line" if $error !~ m{ at };
warn "WARN: $error\n";
- $error =~ s{at\s+(\S+)\s+line\s+(\d+)}{at $1 line $2}gsm;
+ $error =~ s{at\s+(\S+)\s+line\s+(\d+)}{at $1 line $2}gsm;
return qq|
$error|; }