Boost logo

Boost Users :

Subject: [Boost-users] [serialization] xml tag names and exceptions
From: Ashley Smith (yuumei_at_[hidden])
Date: 2009-05-17 10:02:08


Hi, I've been using boost for a while now and it's brilliant! :D

Anyway, I'm using serialization in my code and was wondering why I was
catching an exception where the what() reported "uninitialized
exception". Eventually I worked it out (After much debugging) that I was
catching the exception like this:

} catch( std::exception & e ) {
  std::cout << e.what() << std::endl;

I found out that my xml tags could not have namespace qualifiers in them
(I.e. "blah::abc" would not work) and that it would throw a
boost::archive::xml_archive_exception. This obviously didn't work with
an std::exception and defaulted to an uninitialised exception. So my
question is: am I catching the exceptions in the wrong way? Whats the
right way? Should I use a more specific boost exception class?

Thank-you!
- Ash


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net