Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Today in various KafkaProducer APIs (especially send and transaction related) we wrap many of the underlying exception with a KafkaException. In some nested calls we may even wrap it more than once. Although the initial goal is to not expose the root cause directly to users, it also brings confusion to advanced user's error handling that some KafkaException wrapped root cause may be handled differently.
Since all of those exceptions are public classes anyways (since one can still get them via exception.root()) and they are all inheriting KafkaException, I'd suggest we do not do any wrapping any more and throw the exception directly. For those users who just capture all KafkaException and handle them universally it is still compatible; but for those users who want to handle exceptions differently it would introduce an easier way.
Attachments
Issue Links
- relates to
-
KAFKA-10868 Avoid double wrapping KafkaException
-
- Open
-
- links to