Avro
  1. Avro
  2. AVRO-1465

Lack of information on error in GenericData#getSchemaName

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.7
    • Component/s: java
    • Labels:
      None

      Description

      When the type of a datum cannot be determined in GenericData#getSchemaName, an AvroRuntimeException is thrown (correctly), and the message of the exception contains the string representation of the datum.

      In the odd case that the datum is something that totally doesn't belong there, and it's toString representation doesn't clearly show what it is, it's very difficult to determine what the actual type of the error datum is.

      Including the class name of the unresolvable datum would make debugging situations like this much easier.

      1. AVRO-1465.patch
        0.7 kB
        Gabriel Reid

        Activity

        Hide
        Hudson added a comment -

        SUCCESS: Integrated in AvroJava #446 (See https://builds.apache.org/job/AvroJava/446/)
        AVRO-1465. Java: Improve the error message when union dispatch fails. Contributed by Gabriel Reid. (cutting: rev 1577309)

        • /avro/trunk/CHANGES.txt
        • /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
        Show
        Hudson added a comment - SUCCESS: Integrated in AvroJava #446 (See https://builds.apache.org/job/AvroJava/446/ ) AVRO-1465 . Java: Improve the error message when union dispatch fails. Contributed by Gabriel Reid. (cutting: rev 1577309) /avro/trunk/CHANGES.txt /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
        Hide
        Doug Cutting added a comment -

        I committed this. Thanks, Gabriel.

        Show
        Doug Cutting added a comment - I committed this. Thanks, Gabriel.
        Hide
        ASF subversion and git services added a comment -

        Commit 1577309 from Doug Cutting in branch 'avro/trunk'
        [ https://svn.apache.org/r1577309 ]

        AVRO-1465. Java: Improve the error message when union dispatch fails. Contributed by Gabriel Reid.

        Show
        ASF subversion and git services added a comment - Commit 1577309 from Doug Cutting in branch 'avro/trunk' [ https://svn.apache.org/r1577309 ] AVRO-1465 . Java: Improve the error message when union dispatch fails. Contributed by Gabriel Reid.
        Hide
        Gabriel Reid added a comment -

        Trivial patch to add class name information to the exception that is thrown

        Show
        Gabriel Reid added a comment - Trivial patch to add class name information to the exception that is thrown

          People

          • Assignee:
            Gabriel Reid
            Reporter:
            Gabriel Reid
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development