| 1 | #pragma once |
| 2 | |
| 3 | #include <Common/ZooKeeper/Types.h> |
| 4 | |
| 5 | |
| 6 | namespace zkutil |
| 7 | { |
| 8 | |
| 9 | |
| 10 | using KeeperException = Coordination::Exception; |
| 11 | |
| 12 | |
| 13 | class KeeperMultiException : public KeeperException |
| 14 | { |
| 15 | public: |
| 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 | |
| 28 | private: |
| 29 | static size_t getFailedOpIndex(int32_t code, const Coordination::Responses & responses); |
| 30 | }; |
| 31 | |
| 32 | } |
| 33 | |