Boost C++ Libraries: Ticket #1807: boost::archive::xml_archive_exception does not store error code and reports wrong message text https://svn.boost.org/trac10/ticket/1807 <p> The code in the constructor for boost::archive::xml_archive_exception (basic_xml_archive.hpp) misses to store the error code value. Thus, a default constructed archive_exception is created with an error code of "no_exception". </p> <p> The what() member function of xml_archive_exception therefore always reports the error "xml_archive_parsing_error" even if the true error reason is e. g. "xml_archive_tag_name_error". This happens because the enumeration constants "no_error" and "xml_archive_parsing_error" happen to both have the same integer value of 0. </p> <p> Consequence:<br /> After creating any object of type xml_archive_exception the information about the actual error is lost. </p> <p> Suggestion:<br /> 1) The error enumerations for archive_exception and xml_archive_exception should be combined<br /> 2) The constructor should call archive_exception::archive_exception(exception_code) </p> <p> OR </p> <p> 1) xml_archive_exception should have an exception_code member of its own where the constructor stores its argument<br /> 2) The xml_archive_exception::what() function should first check its own exception_code value and then hand over to the base class function, if no match is found. </p> <p> Merging both exception classes would also be an option, though. </p> <p> Thank you in advance for your assistance. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1807 Trac 1.4.3 Robert Ramey Sun, 08 Jun 2008 06:28:28 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1807#comment:1 https://svn.boost.org/trac10/ticket/1807#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> OK - I made a change which I think will fix this. </p> <p> Robert Ramey </p> Ticket