[serialization] bad alloc and deserialization
Hello all, I have some trouble using boost::serialization : this code ============== try { std::stringstream erroneousStream; erroneousStream << "not a message ! @@@"; boost::archive::text_iarchive input(erroneousStream); Message* deserializedMessage; input >> deserializedMessage; // failure } catch (boost::archive::archive_exception& e){ std::cerr << e.what() << std::endl; } catch (std::exception& e) { std::cerr << e.what () << std::endl; } catch(...) { failmsg("unexpected !"); } =============== fails with a bad alloc exception. I don't think this is a normal behavior. So, what can I do to make this code fail correctly (with an archive_exception or even better with a serialization_exception) ? I must precise that in a normal scenario (with a real serialized message, this works perfectly well ! Any other idea ? Tanks in advance for you answers.
participants (1)
-
Cyril