X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ffatal.hpp;h=85f0ac95a03d046e2b867e500b047db5f9d415dd;hb=921fa70d5f91d895881c19502503cd4bd4bcabde;hp=c1c2b6838fbf929d6d0826e569c857fc8455629b;hpb=35b7e1ac4af1f81704affd6fa94cac09603fdb35;p=awesomized%2Flibmemcached diff --git a/libtest/fatal.hpp b/libtest/fatal.hpp index c1c2b683..85f0ac95 100644 --- a/libtest/fatal.hpp +++ b/libtest/fatal.hpp @@ -43,8 +43,8 @@ public: // The following are just for unittesting the exception class static bool is_disabled(); - static bool disable(); - static bool enable(); + static void disable(); + static void enable(); static uint32_t disabled_counter(); static void increment_disabled_counter(); @@ -52,6 +52,29 @@ private: char _error_message[BUFSIZ]; }; +class disconnected : std::runtime_error +{ +public: + disconnected(const char *file, int line, const char *func, const char *instance, const in_port_t port, const char *format, ...); + + const char* what() const throw() + { + return _error_message; + } + + // The following are just for unittesting the exception class + static bool is_disabled(); + static void disable(); + static void enable(); + static uint32_t disabled_counter(); + static void increment_disabled_counter(); + +private: + char _error_message[BUFSIZ]; + in_port_t _port; + char _instance[1024]; +}; + } // namespace libtest