2 * Drizzle Client & Protocol Library
4 * Copyright (C) 2009 Patrick Galbraith (patg@patg.net)
7 * Use and distribution licensed under the BSD license. See
8 * the COPYING file in this directory for full text.
13 * @brief Exception declarations
16 #ifndef LIBMEMACHED_EXCEPTION_HPP
17 #define LIBMEMACHED_EXCEPTION_HPP
24 class Exception : public std::runtime_error
27 Exception(const std::string& msg, bool errno)
28 : std::runtime_error(msg), _errno(errno) {}
29 Exception(const char *msg, bool errno)
30 : std::runtime_error(msg), _errno(errno) {}
31 virtual ~Exception() throw() {}
33 int getErrno() const { return _errno; }
39 class Warning : public Exception
42 Warning(const std::string& msg, bool errno) : Exception(msg, errno) {}
43 Warning(const char *msg, bool errno) : Exception(msg, errno) {}
46 class Error : public Exception
49 Error(const std::string& msg, bool errno) : Exception(msg, errno) {}
50 Error(const char *msg, bool errno) : Exception(msg, errno) {}
51 virtual ~Error() throw() {}
54 } /* namespace libmemcached */
56 #endif /* LIBMEMACHED_EXCEPTION_HPP */