squah-confluent commented on code in PR #22264:
URL: https://github.com/apache/kafka/pull/22264#discussion_r3257906842


##########
generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java:
##########
@@ -624,15 +624,19 @@ private void generateVariableLengthReader(Versions 
fieldFlexibleVersions,
         buffer.printf("if (%s < 0) {%n", lengthVar);
         buffer.incrementIndent();
         VersionConditional.forVersions(nullableVersions, possibleVersions).
-            ifNotMember(__ -> buffer.printf("throw new 
RuntimeException(\"non-nullable field %s " +
-                "was serialized as null\");%n", name)).
+            ifNotMember(__ -> {
+                
headerGenerator.addImport(MessageGenerator.SCHEMA_EXCEPTION_CLASS);
+                buffer.printf("throw new SchemaException(\"non-nullable field 
%s " +

Review Comment:
   That was my suggestion, sorry. I really didn't like the broadness of the 
`RuntimeException` catch at the `ClassicGroup`-level in the original PR. I 
think if we put the catches in `ConsumerProtocol` that's better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to