[ 
https://issues.apache.org/jira/browse/KAFKA-10830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17306616#comment-17306616
 ] 

Guozhang Wang commented on KAFKA-10830:
---------------------------------------

Hi [~dongjin], I think [~bchen225242] is trying to tackle this as part of the 
on-going KIP-691 but maybe I was wrong, would leave it to him to chime in.

> Kafka Producer API should throw unwrapped exceptions
> ----------------------------------------------------
>
>                 Key: KAFKA-10830
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10830
>             Project: Kafka
>          Issue Type: Improvement
>          Components: producer 
>            Reporter: Guozhang Wang
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to