1#pragma once
2
3#include <Common/ZooKeeper/Types.h>
4
5
6namespace zkutil
7{
8
9
10using KeeperException = Coordination::Exception;
11
12
13class KeeperMultiException : public KeeperException
14{
15public:
16 Coordination::Requests requests;
17 Coordination::Responses responses;
18 size_t failed_op_index = 0;
19
20 std::string getPathForFirstFailedOp() const;
21
22 /// If it is user error throws KeeperMultiException else throws ordinary KeeperException
23 /// If it is ZOK does nothing
24 static void check(int32_t code, const Coordination::Requests & requests, const Coordination::Responses & responses);
25
26 KeeperMultiException(int32_t code, const Coordination::Requests & requests, const Coordination::Responses & responses);
27
28private:
29 static size_t getFailedOpIndex(int32_t code, const Coordination::Responses & responses);
30};
31
32}
33