namespace libt2n
{
-/// a generic exception that can be handeled with libt2n
+/** @brief a generic exception that can be handeled with libt2n
+ @note don't derive the exceptions your application generates directly from this one
+ but use libt2n::t2n_runtime_error for this
+*/
class t2n_exception : public std::exception
{
private:
{ throw *this; }
};
-/// illegal libt2n option set
-class t2n_parameter_error : public t2n_exception
-{
- private:
- friend class boost::serialization::access;
- template<class Archive>
- 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
{
/** @brief a runtime error within the remote function.
derive your own custom exceptions from this one
+
+ @note you must override the virtual clone method if you do so (used by libt2n::command_server::handle())
*/
class t2n_runtime_error : public t2n_exception
{
} // namespace libt2n
+#include "t2n_exception.tcc"
+
#endif