X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Ft2n_exception.hxx;h=a494c8612af742e83ffbb15bf32427f9c284f3b7;hp=c81ba02199e994389c8d2a13871cf475e8e923fd;hb=91730468439e21dcf8d275d0f70d803c20ccaa7c;hpb=7087e18783f91d2b889e880462d1d1da24831c28 diff --git a/src/t2n_exception.hxx b/src/t2n_exception.hxx index c81ba02..a494c86 100644 --- a/src/t2n_exception.hxx +++ b/src/t2n_exception.hxx @@ -23,7 +23,6 @@ #include #include -#include namespace boost { namespace serialization { @@ -47,11 +46,7 @@ class t2n_exception : public std::exception friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(exception); - ar & BOOST_SERIALIZATION_NVP(message); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_exception(const std::string& _message) @@ -79,10 +74,7 @@ class t2n_communication_error : public t2n_exception private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_communication_error(const std::string& _message) @@ -105,10 +97,7 @@ class t2n_connect_error : public t2n_communication_error private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_connect_error(const std::string& _message) @@ -131,10 +120,7 @@ class t2n_server_error : public t2n_communication_error private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_server_error(const std::string& _message) @@ -157,10 +143,7 @@ class t2n_transfer_error : public t2n_communication_error private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_transfer_error(const std::string& _message) @@ -183,10 +166,7 @@ class t2n_version_mismatch : public t2n_communication_error private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_version_mismatch(const std::string& _message) @@ -209,10 +189,7 @@ class t2n_command_error : public t2n_exception private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_command_error(const std::string& _message) @@ -229,16 +206,36 @@ class t2n_command_error : public t2n_exception { throw *this; } }; +/// illegal libt2n option set +class t2n_parameter_error : public t2n_exception +{ + private: + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int version); + + public: + t2n_parameter_error(const std::string& _message) + : t2n_exception(_message) + { } + + t2n_parameter_error() + { } + + t2n_exception* clone() const + { return new t2n_parameter_error(*this); } + + void do_throw() + { throw *this; } +}; + /// error serializing or deserializing a libt2n command packet class t2n_serialization_error : public t2n_exception { private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_serialization_error(const std::string& _message) @@ -263,10 +260,7 @@ class t2n_runtime_error : public t2n_exception private: friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) - { - ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception); - } + void serialize(Archive & ar, const unsigned int version); public: t2n_runtime_error(const std::string& _message)