More informative parser error messages

Issue #146 new
Louise Poubel
created an issue

See this question about parser error messages not being very helpful:

http://answers.gazebosim.org/question/15485/tools-to-validate-sdf-files-with/

The error is coming from here:

https://bitbucket.org/osrf/sdformat/src/57b675057c543cd4466917ae2b534ef1fb7cf16c/src/parser.cc?fileviewer=file-view-default#parser.cc-305

Looking at the TinyXml documentation, it looks like there are more functions which we could use to provide a better indication of the error:

http://www.grinninglizard.com/tinyxmldocs/classTiXmlDocument.html

Comments (1)

  1. clalancette

    Actually, it is a bit worse than that. We have a number of calls to xml.LoadFile()/xml.Parse() all over the source code, and they all report errors slightly differently. We should probably add a helper function that parses a filename or string, and then prints out a good error message. Then we should use it consistently.

  2. Log in to comment