Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3206

Provide more information in serialization error messages in SpecificDatumWriter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.10.2
    • 1.11.0
    • java

    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
      

      Attachments

        Activity

          People

            gkomlossi Gyula Komlossi
            gkomlossi Gyula Komlossi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m