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

AvroTypeException should include fieldName as distinct field

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.7.6
    • None
    • java

    Description

      Currently AvroTypeException is defined as

      public class AvroTypeException extends AvroRuntimeException {
      public AvroTypeException(String message)

      { super(message); }

      public AvroTypeException(String message, Throwable cause)

      { super(message, cause); }

      }

      And when used in JSONDecoder, field name failures are defined like this:

      throw new AvroTypeException("Expected field name not found: " + fa.fname);

      This means that, in the event of an AvroTypeException, the only way to find which field has the error is to scan through the error message.

      If the AvroTypeException had a constructor (message, throwable, field) or a subclass which explicitly provided fields, then it would make error processing much easier.

      Attachments

        Activity

          People

            Unassigned Unassigned
            will_sargent Will Sargent
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: