Modern C++ Kafka API: KAFKA_API::Error Class Reference (original) (raw)
Unified error type. More...
#include <[Error.h](Error%5F8h%5Fsource.html)>
| Public Member Functions | |
|---|---|
| Error (rd_kafka_error_t *error=nullptr) | |
| Error (rd_kafka_resp_err_t respErr) | |
| Error (rd_kafka_resp_err_t respErr, std::string message, bool fatal=false) | |
| Error (const Error &error) | |
| Error & | operator= (const Error &error) |
| operator bool () const | |
| Check if the error is valid. | |
| operator std::error_code () const | |
| Conversion to std::error_code | |
| int | value () const |
| Obtains the underlying error code value. More... | |
| std::string | message () const |
| Readable error string. | |
| std::string | toString () const |
| Detailed error string. | |
| bool | isFatal () const |
| Fatal error indicates that the client instance is no longer usable. | |
| Optional< bool > | isRetriable () const |
| Show whether the operation may be retried. | |
| bool | transactionRequiresAbort () const |
| Show whether the error is an abortable transaction error. More... | |
Unified error type.
◆ transactionRequiresAbort()
| bool KAFKA_API::Error::transactionRequiresAbort ( ) const | inline |
|---|
Show whether the error is an abortable transaction error.
Note:
- Only valid for transactional API.
- If
true, the producer must callabortTransactionand start a new transaction withbeginTransactionto proceed with transactions.
◆ value()
| int KAFKA_API::Error::value ( ) const | inline |
|---|
Obtains the underlying error code value.
Actually, it's the same as 'rd_kafka_resp_err_t', which is defined by librdkafka.
- The negative values are for internal errors.
- Non-negative values are for external errors. See the defination at,
The documentation for this class was generated from the following file:
- /home/runner/work/modern-cpp-kafka/modern-cpp-kafka/include/kafka/Error.h