librdkafka
The Apache Kafka C/C++ client library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RdKafka::Error Class Referenceabstract

The Error class is used as a return value from APIs to propagate an error. The error consists of an error code which is to be used programatically, an error string for showing to the user, and various error flags that can be used programmatically to decide how to handle the error; e.g., should the operation be retried, was it a fatal error, etc. More...

#include <rdkafkacpp.h>

Public Member Functions

virtual ErrorCode code () const =0
 
virtual std::string name () const =0
 
virtual std::string str () const =0
 
virtual bool is_fatal () const =0
 
virtual bool is_retriable () const =0
 
virtual bool txn_requires_abort () const =0
 

Static Public Member Functions

static Errorcreate (ErrorCode code, const std::string *errstr)
 Create error object.
 

Detailed Description

The Error class is used as a return value from APIs to propagate an error. The error consists of an error code which is to be used programatically, an error string for showing to the user, and various error flags that can be used programmatically to decide how to handle the error; e.g., should the operation be retried, was it a fatal error, etc.

Error objects must be deleted explicitly to free its resources.

Member Function Documentation

virtual ErrorCode RdKafka::Error::code ( ) const
pure virtual
Returns
the error code, e.g., RdKafka::ERR_UNKNOWN_MEMBER_ID.
virtual std::string RdKafka::Error::name ( ) const
pure virtual
Returns
the error code name, e.g, "ERR_UNKNOWN_MEMBER_ID".
virtual std::string RdKafka::Error::str ( ) const
pure virtual
Returns
a human readable error string.
virtual bool RdKafka::Error::is_fatal ( ) const
pure virtual
Returns
true if the error is a fatal error, indicating that the client instance is no longer usable, else false.
virtual bool RdKafka::Error::is_retriable ( ) const
pure virtual
Returns
true if the operation may be retried, else false.
virtual bool RdKafka::Error::txn_requires_abort ( ) const
pure virtual
Returns
true if the error is an abortable transaction error in which case the application must call RdKafka::Producer::abort_transaction() and start a new transaction with RdKafka::Producer::begin_transaction() if it wishes to proceed with transactions. Else returns false.
Remarks
The return value of this method is only valid for errors returned by the transactional API.

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