avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1577309 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
Date Thu, 13 Mar 2014 20:39:26 GMT
Author: cutting
Date: Thu Mar 13 20:39:26 2014
New Revision: 1577309

URL: http://svn.apache.org/r1577309
Log:
AVRO-1465. Java: Improve the error message when union dispatch fails.  Contributed by Gabriel
Reid.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1577309&r1=1577308&r2=1577309&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu Mar 13 20:39:26 2014
@@ -27,6 +27,9 @@ Trunk (not yet released)
     AVRO-1472. Java: Clarify parse method in getting started guide.
     (Michael Knapp via cutting)
 
+    AVRO-1465. Java: Improve the error message when union dispatch fails.
+    (Gabriel Reid via cutting)
+
   BUG FIXES
 
     AVRO-1446. C#: Correctly handle system errors in RPC.

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java?rev=1577309&r1=1577308&r2=1577309&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java Thu Mar
13 20:39:26 2014
@@ -636,7 +636,9 @@ public class GenericData {
       return Type.DOUBLE.getName();
     if (isBoolean(datum))
       return Type.BOOLEAN.getName();
-    throw new AvroRuntimeException("Unknown datum type: "+datum);
+    throw new AvroRuntimeException
+      (String.format("Unknown datum type %s: %s",
+                     datum.getClass().getName(), datum));
  }
 
   /** Called by {@link #resolveUnion(Schema,Object)}.  May be overridden for



Mime
View raw message