/* The software in this package is distributed under the GNU General Public License version 2 (with a special exception described below). A copy of GNU General Public License (GPL) is included in this distribution, in the file COPYING.GPL. As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License. This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License. */ /*************************************************************************** exception.hxx - exception classes ------------------- copyright : (C) 2001 by Intra2net AG ***************************************************************************/ #ifndef __EXCEPTION #define __EXCEPTION #include #include #define EXCEPTION(xname,xarg) xname(xarg,__LINE__,__FILE__,__DATE__ " " __TIME__) #define EXCEPTION2(xname,xarg,xarg2) xname(xarg,xarg2,__LINE__,__FILE__,__DATE__ " " __TIME__) class source_info_exception { public: const int line; const char* const file; const char* const timestamp; source_info_exception(const int l, const char* f, const char* t) : line(l), file(f), timestamp(t) {} }; class runtime_error_src : public std::runtime_error, public source_info_exception { public: runtime_error_src(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error(__arg), source_info_exception(l,f,t) {} }; class network_error : public runtime_error_src { public: network_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class network_server_error : public network_error { public: network_server_error(const std::string& __arg,const int l, const char* f, const char* t) : network_error(__arg,l,f,t) {} }; class CONNECTION_SOCKET; class network_client_error : public network_error { public: CONNECTION_SOCKET *con; network_client_error(const std::string& __arg,CONNECTION_SOCKET *c, const int l, const char* f, const char* t) : network_error(__arg,l,f,t), con(c) {} }; class database_error : public runtime_error_src { public: database_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class database_query_error : public database_error { public: database_query_error(const std::string& __arg,const int l, const char* f, const char* t) : database_error(__arg,l,f,t) {} }; class signal_error : public runtime_error_src { public: signal_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class pipestream_error : public runtime_error_src { public: pipestream_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class insocketstream_error : public runtime_error_src { public: insocketstream_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class variable_data_error : public runtime_error_src { public: variable_data_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class variable_range_error : public variable_data_error { public: variable_range_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_double_error : public variable_data_error { public: variable_double_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_ip_error : public variable_data_error { public: variable_ip_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_integrity_error : public variable_data_error { public: variable_integrity_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_instance_error : public variable_data_error { public: variable_instance_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_child_error : public variable_data_error { public: variable_child_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class variable_notfound_error : public variable_data_error { public: variable_notfound_error(const std::string& __arg,const int l, const char* f, const char* t) : variable_data_error(__arg,l,f,t) {} }; class autoupdate_error : public runtime_error_src { public: autoupdate_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class scheduler_dir_error : public runtime_error_src { public: scheduler_dir_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class scheduler_prog_error : public runtime_error_src { public: scheduler_prog_error(const std::string& __arg,const int l, const char* f, const char* t) : runtime_error_src(__arg,l,f,t) {} }; class logic_error_src : public std::logic_error, public source_info_exception { public: logic_error_src(const std::string& __arg,const int l, const char* f, const char* t) : logic_error(__arg), source_info_exception(l,f,t) {} }; class argument_error : public logic_error_src { public: argument_error(const std::string& __arg,const int l, const char* f, const char* t) : logic_error_src(__arg,l,f,t) {} }; class message_error : public logic_error_src { public: message_error(const std::string& __arg,const int l, const char* f, const char* t) : logic_error_src(__arg,l,f,t) {} }; class variable_error : public logic_error_src { public: variable_error(const std::string& __arg,const int l, const char* f, const char* t) : logic_error_src(__arg,l,f,t) {} }; #endif