cppkafka
cppkafka copied to clipboard
Added RdKafkaException base class
- Added
RdKafkaExceptionbase class for exceptions which take anErroras parameter. This allows for easier catching and processing of kafka-specific errors. - In cases where the error message was sinked into the Exception (
ParseExceptionandActionTerminatedException), the signature is pass-by-copy now to be consistent with the baseExceptionclass. This should not break ABI since the constructor is only called internally.
Hi @mfontanini, can you please take a look at this? ~thanks
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_errorwill 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.
Agreed with you. I think it's a worthwhile change with small breakage risk.
@mfontanini are you ok going forward with this? Can we merge it? Otherwise I'll close it.
@mfontanini please check my last comment.