Skip Menu |

This queue is for tickets about the Test-HTML-W3C CPAN distribution.

Report information
The Basics
Id: 66599
Status: new
Priority: 0/
Queue: Test-HTML-W3C

People
Owner: Nobody in particular
Requestors: SILASMONK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: diag_html crashes if the service does not return useable output
proposed patch attached
Subject: diag_html.patch
Author: Nicholas Bamber <nicholas@periapt.co.uk> Subject: Invalid response from service not handled correctly Last-Update: 2011-03-14 --- a/lib/Test/HTML/W3C.pm +++ b/lib/Test/HTML/W3C.pm @@ -224,10 +224,15 @@ sub diag_html { my $tb = __PACKAGE__->builder(); if ($show_detail) { - my @errs = $v->errors(); - my $e; - foreach my $error ( @{$v->errors()} ) { - $e .= sprintf("%s at line %d\n", $error->msg, $error->line); + my $e = ""; + if ($v->errors()) { + my @errs = @{$v->errors()}; + foreach my $error ( @errs ) { + $e .= sprintf("%s at line %d\n", $error->msg, $error->line); + } + } + else { + $e .= $v->validator_error; } $tb->diag($e); } else {