ClickHouse/libs/libzkutil/include/zkutil/KeeperException.h

22 lines
528 B
C
Raw Normal View History

2014-03-07 13:50:58 +00:00
#pragma once
#include <Poco/Exception.h>
#include <zkutil/ZooKeeper.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_)
2014-03-07 17:57:53 +00:00
: Poco::Exception(msg + " (" + ReturnCode::toString(code_) + ")"), code(code_) {}
2014-03-07 13:50:58 +00:00
KeeperException(ReturnCode::type code_)
2014-03-07 17:57:53 +00:00
: Poco::Exception(ReturnCode::toString(code_)), code(code_) {}
2014-03-07 13:50:58 +00:00
ReturnCode::type code;
};
};