diff options
author | ville <ville@localhost> | 2009-12-12 11:15:13 +0000 |
---|---|---|
committer | ville <ville@localhost> | 2009-12-12 11:15:13 +0000 |
commit | 1c3c8f4daa461e88e608b307eec454d43e670875 (patch) | |
tree | f8a3ca959b0bf500dff5e4c48faafcf408f89180 | |
parent | 1de1ffd12c5603b9d86886098df365707b8be936 (diff) | |
download | markup-validator-1c3c8f4daa461e88e608b307eec454d43e670875.zip markup-validator-1c3c8f4daa461e88e608b307eec454d43e670875.tar.gz markup-validator-1c3c8f4daa461e88e608b307eec454d43e670875.tar.bz2 |
Include error message in output when something goes wrong when interfacing with external validators (#5992 comment 13).
-rwxr-xr-x | htdocs/whatsnew.html | 7 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 10 | ||||
-rw-r--r-- | share/templates/en_US/fatal-error.tmpl | 6 |
3 files changed, 17 insertions, 6 deletions
diff --git a/htdocs/whatsnew.html b/htdocs/whatsnew.html index f46e2ca..c36f4ef 100755 --- a/htdocs/whatsnew.html +++ b/htdocs/whatsnew.html @@ -1,5 +1,5 @@ -<!--#set var="revision" value="\$Id: whatsnew.html,v 1.91 2009-12-11 18:40:24 ville Exp $" ---><!--#set var="date" value="\$Date: 2009-12-11 18:40:24 $" +<!--#set var="revision" value="\$Id: whatsnew.html,v 1.92 2009-12-12 11:15:12 ville Exp $" +--><!--#set var="date" value="\$Date: 2009-12-12 11:15:12 $" --><!--#set var="title" value="What's New at The W3C Markup Validation Service" --><!--#set var="relroot" value="./" --><!--#set var="feeds" value="1" @@ -47,8 +47,7 @@ <li> Enhancement: improved error handling and diagnostics for problems occurred when decoding Content-Encodings, when cleaning up - markup with Tidy, and when interpreting non-document errors from - the HTML5 validator. + markup with Tidy, and when interfacing with the HTML5 validator. </li> <li> Enhancement: recognition of more (non-recommended) aliases for diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index c4db09b..f19b923 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -14,7 +14,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.747 2009-12-11 18:40:24 ville Exp $ +# $Id: check,v 1.748 2009-12-12 11:15:13 ville Exp $ # # We need Perl 5.8.0+. @@ -197,7 +197,7 @@ EOF # # Strings - $VERSION = q$Revision: 1.747 $; + $VERSION = q$Revision: 1.748 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # Read friendly error message file @@ -1057,6 +1057,7 @@ sub compoundxml_validate (\$) my $tmpl = &get_template($File, 'fatal-error.tmpl'); $tmpl->param(fatal_no_checker => TRUE); $tmpl->param(fatal_missing_checker => 'HTML5 Validator'); + $tmpl->param(fatal_checker_error => $res->status_line()); } else { my $content = &get_content($File, $res); @@ -1071,10 +1072,12 @@ sub compoundxml_validate (\$) my $xmlDOM; eval { $xmlDOM = $xml_reader->parse_string($content); }; if ($@) { + my $errmsg = $@; $File->{'Error Flagged'} = TRUE; my $tmpl = &get_template($File, 'fatal-error.tmpl'); $tmpl->param(fatal_no_checker => TRUE); $tmpl->param(fatal_missing_checker => 'HTML5 Validator'); + $tmpl->param(fatal_checker_error => $errmsg); return $File; } my @nodelist = $xmlDOM->getElementsByTagName("messages"); @@ -1213,6 +1216,7 @@ sub html5_validate (\$) my $tmpl = &get_template($File, 'fatal-error.tmpl'); $tmpl->param(fatal_no_checker => TRUE); $tmpl->param(fatal_missing_checker => 'HTML5 Validator'); + $tmpl->param(fatal_checker_error => $res->status_line()); } else { my $content = &get_content($File, $res); @@ -1227,10 +1231,12 @@ sub html5_validate (\$) my $xmlDOM; eval { $xmlDOM = $xml_reader->parse_string($content); }; if ($@) { + my $errmsg = $@; $File->{'Error Flagged'} = TRUE; my $tmpl = &get_template($File, 'fatal-error.tmpl'); $tmpl->param(fatal_no_checker => TRUE); $tmpl->param(fatal_missing_checker => 'HTML5 Validator'); + $tmpl->param(fatal_checker_error => $errmsg); return $File; } my @nodelist = $xmlDOM->getElementsByTagName("messages"); diff --git a/share/templates/en_US/fatal-error.tmpl b/share/templates/en_US/fatal-error.tmpl index b44d551..2b45631 100644 --- a/share/templates/en_US/fatal-error.tmpl +++ b/share/templates/en_US/fatal-error.tmpl @@ -16,6 +16,12 @@ in this validator, or is currently unavailable. Check in the validator's system configuration that <TMPL_IF NAME="fatal_missing_checker"><TMPL_VAR NAME="fatal_missing_checker"> is enabled and functional<TMPL_ELSE>all external checkers are enabled, and test if they are responsive</TMPL_IF>. </p> + <TMPL_IF NAME="fatal_checker_error"> + <p> + The error encountered was: + <code><TMPL_VAR NAME="fatal_checker_error" ESCAPE="HTML"></code> + </p> + </TMPL_IF> </li> </TMPL_IF> <TMPL_IF NAME="fatal_transcode_error"> |