[
https://issues.apache.org/jira/browse/AVRO-1113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13293975#comment-13293975
]
David Taylor commented on AVRO-1113:
------------------------------------
I can see why, the test case just checks that the error string includes the
exception text "foo". That is a bit too lax I think. The problem is not that
the exception text is lost completely, it does come through, just that it is
wrapped in an AvroRuntimeException("Unknown datum type: "+datum) error. So
instead of the expected "java.lang.RuntimeException: foo" text being sent you
get "org.apache.avro.AvroRuntimeException: Unknown datum type:
java.lang.RuntimeException: foo".
The cause is that the call to SpecificResponder.writeError in Responder.respond
ultimately calls GenericData.resolveUnion which in turn calls
GenericData.getSchemaName before the line where the UnresolvedUnionException
gets thrown. GenericData.getSchemaName instead throws an AvroRuntimeException
so the special handling of UnresolvedUnionException in Responder.respond is
skipped and the nested exception text is the result.
> AVRO-946 breaks AVRO-723
> ------------------------
>
> Key: AVRO-1113
> URL: https://issues.apache.org/jira/browse/AVRO-1113
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.6.3
> Reporter: David Taylor
> Priority: Minor
>
> It appears that AVRO-946 breaks AVRO-723. Undeclared exceptions now generate
> "Unknown datum type" error messages rather than the original exception. This
> is because the call to getSchemaName introduced in AVRO-946 with an
> undeclared exception will now generate an AvroRuntimeException with the above
> error message, rather than the UnresolvedUnionException error that I believe
> was the intent of AVRO-723.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira