zookeeper-cpp
ZooKeeper Client for C++
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
zk::transaction_failed Class Referencefinal

Thrown from client::commit when a transaction cannot be committed to the system. More...

#include <zk/error.hpp>

+ Inheritance diagram for zk::transaction_failed:

Public Member Functions

 transaction_failed (error_code code, std::size_t op_index)
 
error_code underlying_cause () const
 The underlying cause that caused this transaction to be aborted. More...
 
std::size_t failed_op_index () const
 The transaction index which caused the error (0 indexed). More...
 
- Public Member Functions inherited from zk::check_failed
 check_failed (error_code code, const std::string &description)
 
- Public Member Functions inherited from zk::error
 error (error_code code, const std::string &description)
 
error_code code () const
 The code representation of this error. More...
 

Detailed Description

Thrown from client::commit when a transaction cannot be committed to the system.

Check the underlying_cause to see the specific error and failed_op_index to see what operation failed.

Definition at line 388 of file error.hpp.

Member Function Documentation

std::size_t zk::transaction_failed::failed_op_index ( ) const
inline

The transaction index which caused the error (0 indexed).

If the 3rd operation in the multi_op could not be committed, this will be 2.

Definition at line 402 of file error.hpp.

error_code zk::transaction_failed::underlying_cause ( ) const
inline

The underlying cause that caused this transaction to be aborted.

For example, if a op::set operation is attempted on a node that does not exist, this will be error_code::no_entry.

Definition at line 398 of file error.hpp.


The documentation for this class was generated from the following files: