
Igor R wrote:
Hello,
Consider the following structure:
struct outer { inner_type1 inner1_; inner_type2 inner2_;
template<class Archive> void HostPort::load(Archive &ar, const unsigned int version) { ar >> BOOST_SERIALIZATION_NVP(inner1_); ar >> BOOST_SERIALIZATION_NVP(inner2_); } };
Assume that loading of inner1_ throws exception. Is there a way to "unwind" the "stack" of objects gracefully (i.e. to skip until some "end" marker of inner1_), and to proceed loading the next inner object normally?
Note that the the serialization library does throw exceptions on failure. These exceptions are documented in the manual. You should be able to catch these exceptions in your own save/load functions. I can't say to what extent one might be able to recover. Implementing this would likely require more elaborat save/load functions. Robert Ramey
Thanks.