Re: [PATCH] Include offending XML in "Malformed XML" error message
From: Charles Bailey <bailey.charles_at_gmail.com>
Date: 2005-02-27 00:20:28 CET
On Thu, 24 Feb 2005 14:17:20 +0100 (CET), Peter N. Lundblad
> We generally try to avoid line breaks in error messages. That's because of
> > - I placed delimiters before and after the XML with the thought that
OK, as 1 of 1 respondents recommends dropping them, they're gone.
> Good start:-) A few commets below. (Also, could you please try to get the
Definitely. I put a little too much faith in the mail client's
>> Display fragment of offending XML on "Malformed XML" error
OK -- I overtrained on incidental details in HACKING.
> + _("Malformed XML: %s at line %d; XML %s:\n>>>>>\n%.240s\n<<<<<\n"),
OK -- my oversight. Sorry. The problem's really not worth two
A revised patch is appended below my sig, with appropriate attention
-- Regards, Charles Bailey Lists: bailey _dot_ charles _at_ gmail _dot_ com Other: bailey _at_ newman _dot_ upenn _dot_ edu Display XML fragment in "Malformed XML" error message to aid debugging. * subversion/libsvn_subr/xml.c (svn_xml_parse): Append reasonable hunk of XML to error message * subversion/po/de.po, subversion/po/es.po, subversion/po/ja.po, subversion/po/ko.po, subversion/po/nb.po, subversion/po/pl.po, subversion/po/pt_BR.po, subversion/po/sv.po, subversion/po/zh_CN.po, subversion/po/zh_CN.po: Update error message. Index: subversion/libsvn_subr/xml.c =================================================================== --- subversion/libsvn_subr/xml.c (revision 13160) +++ subversion/libsvn_subr/xml.c (working copy) @@ -417,9 +417,9 @@ { err = svn_error_createf (SVN_ERR_XML_MALFORMED, NULL, - _("Malformed XML: %s at line %d"), + _("Malformed XML: %s at line %d; XML starts:\n%.240s"), XML_ErrorString (XML_GetErrorCode (svn_parser->parser)), - XML_GetCurrentLineNumber (svn_parser->parser)); + XML_GetCurrentLineNumber (svn_parser->parser), buf); /* Kill all parsers and return the expat error */ svn_xml_free_parser (svn_parser); Index: subversion/po/pt_BR.po =================================================================== --- subversion/po/pt_BR.po (revision 13160) +++ subversion/po/pt_BR.po (working copy) @@ -4943,8 +4943,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "XML mal formado: %s na linha %d" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "XML mal formado: %s na linha %d; XML começa:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/es.po =================================================================== --- subversion/po/es.po (revision 13160) +++ subversion/po/es.po (working copy) @@ -5011,8 +5011,8 @@ #: libsvn_subr/xml.c:420 #, fuzzy, c-format -msgid "Malformed XML: %s at line %d" -msgstr "Datos de flujo malformados" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "Datos de XML malformados: %s en lÃnea %d; XML comienza:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/sv.po =================================================================== --- subversion/po/sv.po (revision 13160) +++ subversion/po/sv.po (working copy) @@ -4930,8 +4930,8 @@ #: libsvn_subr/xml.c:367 #, fuzzy, c-format -msgid "Malformed XML: %s at line %d" -msgstr "Felaktig data i ström" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "Felaktig data i ström: %s vid rad %d; XML starta:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/de.po =================================================================== --- subversion/po/de.po (revision 13160) +++ subversion/po/de.po (working copy) @@ -5006,8 +5006,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "Fehlerhaftes XML: %s in Zeile %d" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "Fehlerhaftes XML: %s in Zeile %d; XML beginnt:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/ko.po =================================================================== --- subversion/po/ko.po (revision 13160) +++ subversion/po/ko.po (working copy) @@ -4882,8 +4882,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "ìž˜ëª»ëœ XML: %s (줄 번호 %d)" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "ìž˜ëª»ëœ XML: %s (줄 번호 %d); XML:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/ja.po =================================================================== --- subversion/po/ja.po (revision 13160) +++ subversion/po/ja.po (working copy) @@ -5262,8 +5262,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "異常㪠XML ã§ã™: %s (è¡Œ %d)" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "異常㪠XML ã§ã™: %s (è¡Œ %d); XML:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/zh_TW.po =================================================================== --- subversion/po/zh_TW.po (revision 13160) +++ subversion/po/zh_TW.po (working copy) @@ -4890,8 +4890,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "有缺陷 XML: %s 於第 %d 列" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "有缺陷 XML: %s 於第 %d 列; XML:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/pl.po =================================================================== --- subversion/po/pl.po (revision 13160) +++ subversion/po/pl.po (working copy) @@ -5054,8 +5054,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "Uszkodzony XML: %s w linii %d" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "Uszkodzony XML: %s w linii %d; XML wersja:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/nb.po =================================================================== --- subversion/po/nb.po (revision 13160) +++ subversion/po/nb.po (working copy) @@ -4935,8 +4935,8 @@ #: libsvn_subr/xml.c:420 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "Misdannet XML: %s i linje %d" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "Misdannet XML: %s i linje %d; XML starter:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format Index: subversion/po/zh_CN.po =================================================================== --- subversion/po/zh_CN.po (revision 13160) +++ subversion/po/zh_CN.po (working copy) @@ -4805,8 +4805,8 @@ #: libsvn_subr/xml.c:367 #, c-format -msgid "Malformed XML: %s at line %d" -msgstr "畸形的XML:%s 在第 %d è¡Œ" +msgid "Malformed XML: %s at line %d; XML starts:\n%.240s" +msgstr "畸形的XML:%s 在第 %d è¡Œ; XML:\n%.240s" #: libsvn_wc/adm_crawler.c:374 #, c-format ## End of patch ## --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Sun Feb 27 00:21:37 2005 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.