[ https://issues.apache.org/jira/browse/KAFKA-3426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202408#comment-15202408 ]
ASF GitHub Bot commented on KAFKA-3426: --------------------------------------- GitHub user ijuma opened a pull request: https://github.com/apache/kafka/pull/1100 KAFKA-3426; Improve protocol type errors when invalid sizes are received You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijuma/kafka kafka-3426-invalid-protocol-type-errors-invalid-sizes Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1100.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1100 ---- commit 24f1425677e73090d9f2e8fc126b6e3f103f28c9 Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-03-19T00:19:23Z KAFKA-3426; Improve protocol type errors when invalid sizes are received ---- > Improve protocol type errors when invalid sizes are received > ------------------------------------------------------------ > > Key: KAFKA-3426 > URL: https://issues.apache.org/jira/browse/KAFKA-3426 > Project: Kafka > Issue Type: Improvement > Reporter: Ismael Juma > Assignee: Ismael Juma > > We currently don't perform much validation on the size value read by the > protocol types. This means that we end up throwing exceptions like > `BufferUnderflowException`, `NegativeArraySizeException`, etc. `Schema.read` > catches these exceptions and adds some useful information like: > {code} > throw new SchemaException("Error reading field '" + fields[i].name + > "': " + > (e.getMessage() == null ? > e.getClass().getName() : e.getMessage())); > {code} > We could do even better by throwing a `SchemaException` with a more user > friendly message. -- This message was sent by Atlassian JIRA (v6.3.4#6332)