[
https://issues.apache.org/jira/browse/AVRO-3206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gyula Komlossi updated AVRO-3206:
---------------------------------
Description:
In certain cases, when there is an error (like NPE, ClassCastException) in the
"*writeField*" method of the "*SpecificDatumWriter*" class, the thrown
exception doesn't contain the specific field causing the problem.
Similarly as implemented in GenericDatumWriter, the same exceptions could be
caught and their message improved by adding the related field name causing the
problem.
Currently, the message is like this:
{code:java}
java.lang.NullPointerException: null of string of
org.apache.avro.test.TestRecord
{code}
But with the improvement it would be:
{code:java}
java.lang.NullPointerException: null of string in field 'name' of
org.apache.avro.test.TestRecord
{code}
was:
In certain cases, when there is an error (like NPE, ClassCastException) in the
"*writeField*" method of the "*SpecificDatumWriter*" class, the thrown
exception doesn't contain the specific field causing the problem.
Similarly as implemented in GenericDatumWriter, the same exceptions could be
caught and their message improved by adding the related field name causing the
problem.
Currently, the message is like this:
{code:java}
java.lang.NullPointerException: null of string of
org.apache.avro.test.TestRecord
{code}
But with the improvement it would be:
{code:java}
java.lang.NullPointerException: null of string in field name of
org.apache.avro.test.TestRecord
{code}
> Provide more information in serialization error messages in
> SpecificDatumWriter
> -------------------------------------------------------------------------------
>
> Key: AVRO-3206
> URL: https://issues.apache.org/jira/browse/AVRO-3206
> Project: Apache Avro
> Issue Type: Improvement
> Components: java
> Affects Versions: 1.10.2
> Reporter: Gyula Komlossi
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> In certain cases, when there is an error (like NPE, ClassCastException) in
> the "*writeField*" method of the "*SpecificDatumWriter*" class, the thrown
> exception doesn't contain the specific field causing the problem.
> Similarly as implemented in GenericDatumWriter, the same exceptions could be
> caught and their message improved by adding the related field name causing
> the problem.
> Currently, the message is like this:
> {code:java}
> java.lang.NullPointerException: null of string of
> org.apache.avro.test.TestRecord
> {code}
> But with the improvement it would be:
> {code:java}
> java.lang.NullPointerException: null of string in field 'name' of
> org.apache.avro.test.TestRecord
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)