DESCRIPTION

The \*(C`error_handler\*(C' and \*(C`errors\*(C' methods of \*(C`HTML::HTML5::Parser\*(C' generate \*(C`HTML::HTML5::Parser::Error\*(C' objects.

\*(C`HTML::HTML5::Parser::Error\*(C' overloads stringification, so can be printed, matched against regular expressions, etc.

Note that HTML::HTML5::Parser is not a validation tool, and there are many classes of error that it does not care about, so will not raise.

Constructor

Constructs a new \*(C`HTML::HTML5::Parser::Error\*(C' object.

Methods

Returns the level of error. ('\s-1MUST\s0', '\s-1SHOULD\s0', '\s-1WARN\s0', '\s-1INFO\s0' or undef.) Returns the parsing layer involved, often undef. e.g. 'encode'. Returns the type of error as a string. Returns the tag name (if any).

  ($line, $col) = $error->source_line();
  $line = $error->source_line;

In scalar context, \*(C`source_line\*(C' returns the line number of the source code that triggered the error. In list context, returns a line/column pair. (Tab characters count as one column, not eight.) Returns a friendly error string.

RELATED TO HTML::HTML5::Parser::Error…

HTML::HTML5::Parser.

AUTHOR

Toby Inkster, <[email protected]>

COPYRIGHT AND LICENSE

Copyright (C) 2011-2012 by Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER OF WARRANTIES

\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.