CC: | moseley [...] hank.org |
Subject: | Better context in XML error messages |
See attached email from Bill Mosley. A small change to the construction
of the XML::Parser object will allow the parse-error messages to report
better context. Note that this may or may not carry over well when the
switch to XML::LibXML is made.
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray Silicon Valley Scale Modelers:
http://www.svsm.org
rjray@blackperl.com
randy.j.ray@gmail.com
Subject: | Error logging in RPC::XML.eml |
Hi Randy,
I was getting errors like this in my logs:
Jul 29 15:48:16 [ERROR] "Failed XMLRPC parsing:
mismatched tag at line 1, column 597, byte 597
mismatched tag at line 1, column 615, byte 597
But no context. I'm parsing on-the-fly so I don't really have easy
access to the XML to print it out.
But, it seems if this is added to the parser creation:
ErrorContext => 1
Then I get much nicer output:
mismatched tag at line 1, column 44, byte 44:
<?xml version="1.0" encoding="UTF-8"?><hi></lo>
===========================================^
Think that would be a good default?