On Sun, Nov 15, 2009 at 8:07 AM, Tomas Doran <bobtf...@bobtfish.net> wrote:
> > >> Could this message be updated to report the length of the body read, too? >> And maybe display the last X bytes of data read might be useful in some >> cases. >> > > You haven't told us what the error actually is? Did you miss the subject of the message? Or do you mean why I got the error I quoted in the subject? I'm not sure why I got the error. I see it somewhat often, but I'm not sure if it's a client overstating the content length or something else. That's why I was asking about having the error provide more info. while ( my $buffer = $self->read($c) ) { $c->prepare_body_chunk($buffer); } # paranoia against wrong Content-Length header my $remaining = $length - $self->read_position; if ( $remaining > 0 ) { $self->finalize_read($c); Catalyst::Exception->throw( "Wrong Content-Length value: $length" ); } So, either read returned false before it should have (seems unlikely it would be empty string or zero) or client overstated. Again, I tend to get a separate error if the client aborts. Can you think of how that error might be more informative? Might be somewhat helpful to see the last chunk from read or the body. E.g. Expected $content_length bytes but read only $body_length. Last 100 bytes are: $last_chunk. -- Bill Moseley mose...@hank.org
_______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/