ClickHouse/libs/libzkutil/include/zkutil/KeeperException.h
2014-03-07 23:19:06 +04:00

22 lines
524 B
C++

#pragma once
#include <Poco/Exception.h>
#include <zkutil/Types.h>
namespace zkutil
{
class KeeperException : public Poco::Exception
{
public:
KeeperException(const std::string & msg) : Poco::Exception(msg), code(ReturnCode::Ok) {}
KeeperException(const std::string & msg, ReturnCode::type code_)
: Poco::Exception(msg + " (" + ReturnCode::toString(code_) + ")"), code(code_) {}
KeeperException(ReturnCode::type code_)
: Poco::Exception(ReturnCode::toString(code_)), code(code_) {}
ReturnCode::type code;
};
};