On Mon, Jan 11, 2010 at 1:29 PM, Philip Martin
<philip.mar...@wandisco.com> wrote:
> Ivan Zhakov <i...@visualsvn.com> writes:
>
>> -  return ne_xml_parse(pwb->parser, data, len);
>> +  parser_status = ne_xml_parse(pwb->parser, data, len);
>> +  if (parser_status)
>> +  {
>> +      /* Pass XML parser error. */
>> +      ne_set_error(pwb->req->ne_sess, "%s", ne_xml_get_error(pwb->parser));
>> +  }
>> +
>> +  return parser_status;
>
> There's another call to ne_xml_parse in that file, in
> parse_spool_file. Should we make the same change there?
>
Good point, but XML parser neon is wrapped in parsed_request()
function after calling parse_spool_file(). I updated my patch to
return the same error message as parsed_request():
[[[
svn: The OPTIONS request returned invalid XML in the response: XML parse error a
t line 1: no element found (https://svn.apache.org/repos/)
]]]

I like my original error message, but consistency is more important IMHO.

-- 
Ivan Zhakov
VisualSVN Team
Index: subversion/libsvn_ra_neon/util.c
===================================================================
--- subversion/libsvn_ra_neon/util.c    (revision 897557)
+++ subversion/libsvn_ra_neon/util.c    (working copy)
@@ -1089,6 +1089,7 @@
 {
   parser_wrapper_baton_t *pwb = baton;
   svn_ra_neon__session_t *sess = pwb->req->sess;
+  int parser_status;
 
   if (pwb->req->err)
     return 1;
@@ -1101,7 +1102,20 @@
   if (pwb->req->err)
     return 1;
 
-  return ne_xml_parse(pwb->parser, data, len);
+  parser_status = ne_xml_parse(pwb->parser, data, len);
+  if (parser_status)
+  {
+      /* Pass XML parser error. */
+      pwb->req->err = svn_error_createf
+          (SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+           _("The %s request returned invalid XML "
+           "in the response: %s (%s)"),
+           pwb->req->method,
+           ne_xml_get_error(pwb->parser),
+           pwb->req->url);
+  }
+
+  return parser_status;
 }
 
 ne_xml_parser *

Reply via email to