On Fri, Jan 8, 2010 at 4:22 PM, Julian Foad <julianf...@btopenworld.com> wrote: > What happens if I accidentally specify a URL that's not a repository? > (Recent trunk build, Neon.) > >> $ svn checkout https://svn.apache.org/repos/ >> svn: OPTIONS of 'https://svn.apache.org/repos': 200 OK >> (https://svn.apache.org) > > This is a truly awful error message, appearing alone as it does. Google > reveals that many users have spent hours trying to track down the cause > of such errors. They appear in all repository operations, not just > checkout. For example, > <http://forum.joomla.org/viewtopic.php?f=406&t=205587> (during import; > unresolved) and > <http://stackoverflow.com/questions/1025377/an-svn-error-200-ok-when-checking-out-from-my-online-repo> > (during checkout; SSH credentials not provided). > > Hi Julian,
Fully agree with you that this message is really confusing. > What do we need to do? Two things, I think: > > 1. That low-level error report needs to be better. Any low-level > function that regards a "200 OK" response as an error must not just > create an error object saying "200 OK" alone but must wrap or replace > that with an error message that indicates what it was trying to do and > why an "OK" response is wrong. > Please consider attached patch to turn 200 OK error message to more descriptive one: svn: OPTIONS of 'https://svn.apache.org/repos/': XML parse error at line 1: no element found (https://svn.apache.org) [[[ Improve RA neon error message when non XML response received. * subversion/libsvn_ra_neon/util.c (wrapper_reader_cb): Wrap neon XML parser error. ]]] PS: Tests are still running. -- 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,14 @@ 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. */ + ne_set_error(pwb->req->ne_sess, "%s", ne_xml_get_error(pwb->parser)); + } + + return parser_status; } ne_xml_parser *