.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::HTML5::Parser::Error 3pm" .TH HTML::HTML5::Parser::Error 3pm "2022-08-28" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::HTML5::Parser::Error \- an error that occurred during parsing .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`error_handler\*(C'\fR and \f(CW\*(C`errors\*(C'\fR methods of \f(CW\*(C`HTML::HTML5::Parser\*(C'\fR generate \&\f(CW\*(C`HTML::HTML5::Parser::Error\*(C'\fR objects. .PP \&\f(CW\*(C`HTML::HTML5::Parser::Error\*(C'\fR overloads stringification, so can be printed, matched against regular expressions, etc. .PP 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. .SS "Constructor" .IX Subsection "Constructor" .ie n .IP """new(level=>$level, type=>$type, token=>$token, ...)""" 4 .el .IP "\f(CWnew(level=>$level, type=>$type, token=>$token, ...)\fR" 4 .IX Item "new(level=>$level, type=>$type, token=>$token, ...)" Constructs a new \f(CW\*(C`HTML::HTML5::Parser::Error\*(C'\fR object. .SS "Methods" .IX Subsection "Methods" .ie n .IP """level""" 4 .el .IP "\f(CWlevel\fR" 4 .IX Item "level" Returns the level of error. ('\s-1MUST\s0', '\s-1SHOULD\s0', '\s-1WARN\s0', '\s-1INFO\s0' or undef.) .ie n .IP """layer""" 4 .el .IP "\f(CWlayer\fR" 4 .IX Item "layer" Returns the parsing layer involved, often undef. e.g. 'encode'. .ie n .IP """type""" 4 .el .IP "\f(CWtype\fR" 4 .IX Item "type" Returns the type of error as a string. .ie n .IP """tag_name""" 4 .el .IP "\f(CWtag_name\fR" 4 .IX Item "tag_name" Returns the tag name (if any). .ie n .IP """source_line""" 4 .el .IP "\f(CWsource_line\fR" 4 .IX Item "source_line" .Vb 2 \& ($line, $col) = $error\->source_line(); \& $line = $error\->source_line; .Ve .Sp In scalar context, \f(CW\*(C`source_line\*(C'\fR returns the line number of the source code that triggered the error. .Sp In list context, returns a line/column pair. (Tab characters count as one column, not eight.) .ie n .IP """to_string""" 4 .el .IP "\f(CWto_string\fR" 4 .IX Item "to_string" Returns a friendly error string. .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::HTML5::Parser. .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2011\-2012 by Toby Inkster .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0