Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.10.2
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:
java.lang.NullPointerException: null of string of org.apache.avro.test.TestRecord
But with the improvement it would be:
java.lang.NullPointerException: null of string in field 'name' of org.apache.avro.test.TestRecord