cppkafka icon indicating copy to clipboard operation
cppkafka copied to clipboard

Added RdKafkaException base class

Open accelerated opened this issue 6 years ago • 5 comments

  • Added RdKafkaException base class for exceptions which take an Error as parameter. This allows for easier catching and processing of kafka-specific errors.
  • In cases where the error message was sinked into the Exception (ParseException and ActionTerminatedException), the signature is pass-by-copy now to be consistent with the base Exception class. This should not break ABI since the constructor is only called internally.

accelerated avatar Jan 06 '20 16:01 accelerated

Hi @mfontanini, can you please take a look at this? ~thanks

accelerated avatar Jan 13 '20 21:01 accelerated

While I'm okay with these changes and this should probably have been done this way from the start, this change breaks the ABI and API. This:

  • Assumes nobody is throwing these exceptions manually (e.g. while testing code).
  • Breaks the API as code calling e.g. QueueException::get_error will now fail to link.
  • (potentially) changes the layout of these exceptions. I think in practice they'll end up having the same layout but it's a risky change.

Having said that, I don't think it's worth bumping the major version for such a simple change.

mfontanini avatar Jan 13 '20 21:01 mfontanini

Agreed with you. I think it's a worthwhile change with small breakage risk.

accelerated avatar Jan 13 '20 22:01 accelerated

@mfontanini are you ok going forward with this? Can we merge it? Otherwise I'll close it.

accelerated avatar Jan 27 '20 17:01 accelerated

@mfontanini please check my last comment.

accelerated avatar Feb 17 '20 16:02 accelerated