21 CassandraError() =
default;
37 requires std::is_convertible_v<T, std::string>
39 return lhs + rhs.message();
44 operator==(T
const& lhs, CassandraError
const& rhs)
45 requires std::is_convertible_v<T, std::string>
47 return lhs == rhs.message();
50 template <std::
integral T>
52 operator==(T
const& lhs, CassandraError
const& rhs)
54 return lhs == rhs.code();
58 operator<<(std::ostream& os, CassandraError
const& err)
89 return code_ == CASS_ERROR_LIB_NO_HOSTS_AVAILABLE or
90 code_ == CASS_ERROR_LIB_REQUEST_TIMED_OUT or code_ == CASS_ERROR_SERVER_UNAVAILABLE or
91 code_ == CASS_ERROR_SERVER_OVERLOADED or code_ == CASS_ERROR_SERVER_READ_TIMEOUT;
100 return code_ == CASS_ERROR_SERVER_INVALID_QUERY;
A simple container for both error message and error code.
Definition Error.hpp:15
CassandraError(std::string message, uint32_t code)
Construct a new CassandraError object.
Definition Error.hpp:29
bool isTimeout() const
Definition Error.hpp:87
bool isInvalidQuery() const
Definition Error.hpp:98
uint32_t code() const
Definition Error.hpp:78
std::string message() const
Definition Error.hpp:69
This namespace implements a wrapper for the Cassandra C++ driver.
Definition CassandraBackendFamily.hpp:47
std::ostream & operator<<(std::ostream &stream, Status const &status)
Definition Errors.cpp:26