Replaced termination callback with throwing exception

This commit is contained in:
Alexander Damian
2019-04-24 10:30:32 -04:00
parent e8c4397b66
commit 0c1119727b
6 changed files with 73 additions and 34 deletions

View File

@@ -42,6 +42,10 @@ namespace cppkafka {
*/
class CPPKAFKA_API Error {
public:
/**
* @brief Constructs an error object with RD_KAFKA_RESP_ERR_NO_ERROR
*/
Error() = default;
/**
* Constructs an error object
*/
@@ -77,7 +81,7 @@ public:
*/
CPPKAFKA_API friend std::ostream& operator<<(std::ostream& output, const Error& rhs);
private:
rd_kafka_resp_err_t error_;
rd_kafka_resp_err_t error_{RD_KAFKA_RESP_ERR_NO_ERROR};
};
} // cppkafka