Hey Stanislav, I should have noticed it earlier from your example, but I just realized that interfaces don't mix well with exceptions. There is no way to catch the interface type, which means you have to depend on instanceof checks, which is not very conventional. At the moment, we raise SerializationException if there is a problem parsing the error, and we raise KafkaException if the record fails its CRC check. Since SerializationException extends KafkaExeption, it seems like we can handle both cases in a compatible way by handling both cases with a single type that extends SerializationException. Maybe something like RecordDeserializationException?
Thanks, Jason On Thu, Aug 2, 2018 at 5:45 AM, Ted Yu <yuzhih...@gmail.com> wrote: > +1 > -------- Original message --------From: Stanislav Kozlovski < > stanis...@confluent.io> Date: 8/2/18 2:41 AM (GMT-08:00) To: > dev@kafka.apache.org Subject: [VOTE] KIP-334 Include partitions in > exceptions raised during consumer record deserialization/validation > Hey everybody, > > I'd like to start a vote thread for KIP-334 Include partitions in > exceptions raised during consumer record deserialization/validation > <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=87297793 > > > > -- > Best, > Stanislav >