Subject: [Boost-bugs] [Boost C++ Libraries] #3212: Unregistered class exception on serialization should have more information
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-24 01:48:36
#3212: Unregistered class exception on serialization should have more information
--------------------------+-------------------------------------------------
Reporter: sohail | Owner: ramey
Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: serialization
Version: Boost 1.34.1 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
If I am serializing a class by base-class pointer and it turns out to be
unregistered, it would be extremely helpful if the code could add the
typeid of the class to some sort of debug output. This can be disabled in
release mode.
I have just spent close to 4 hours debugging this in a maze of serialized
classes with, I'm sorry to say, not very good unit tests.
What I have done is added a local string variable, something like:
{{{
if(NULL == true_type){
std::string derived_type_name = typeid(t).name();
boost::throw_exception(
archive_exception(archive_exception::unregistered_class)
);
}
}}}
Then in the debugger, I can inspect the value of derived_type_name to see
what has not been properly registered.
I think this would help people out immensely. I would submit a patch but
not sure what would be acceptable.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3212> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC