[
https://issues.apache.org/jira/browse/AVRO-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Doug Cutting resolved AVRO-846.
-------------------------------
Resolution: Duplicate
This was fixed as a part of AVRO-839.
> Error record classes do not allow you to set the exception message or cause
> on construction
> -------------------------------------------------------------------------------------------
>
> Key: AVRO-846
> URL: https://issues.apache.org/jira/browse/AVRO-846
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.5.1
> Reporter: Alex Miller
>
> Generated error record classes create only a no-arg constructor, thus there
> is no way to construct one that has a message. You can set the cause via the
> initCause() method but it would be nice to also allow for that. It would be
> nice to replicate all of the Throwable constructors instead of just the no
> arg one.
> The use case that prompted this question was one where the error record
> carried a meaningful message from the server side. When you print stack
> traces or look at them you most naturally look at the message in the
> exception rather than the error record value within the AvroRemoteException.
> We would like to be able to create a new copy of the exception that sets the
> message from within the record's fields so that the error is more visible in
> standard Java infrastructure. Alternately, error records could have a
> well-known field or way to designate a message that could make their way into
> the message of the client-side exception. I don't know how this problem
> translates into other language bindings.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira