You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Yibing Shi (JIRA)" <ji...@apache.org> on 2016/08/23 13:44:20 UTC
[jira] [Commented] (AVRO-1901) creating a record called "Exception"
leads to generated code not compiling
[ https://issues.apache.org/jira/browse/AVRO-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432801#comment-15432801 ]
Yibing Shi commented on AVRO-1901:
----------------------------------
[~radai], are you trying to define an error in your IDL? If yes, have you tried the keyword {{error}} as shown in [this doc|https://avro.apache.org/docs/1.8.1/idl.html#format_records]?
> creating a record called "Exception" leads to generated code not compiling
> --------------------------------------------------------------------------
>
> Key: AVRO-1901
> URL: https://issues.apache.org/jira/browse/AVRO-1901
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.7.7, 1.8.1, 1.9.0
> Reporter: radai rosenblatt
>
> consider the following *.avsc file:
> {code:title=Exception.avsc}
> {
> "type": "record",
> "name": "Exception",
> "namespace": "com.acme",
> "fields" : [
> {"name": "value", "type": "int"}
> ],
> "doc": "Will not submit to your fascist naming conventions"
> }
> {code}
> the generated java code will contain:
> {code:title=Exception.java}
> ...
> @override
> public Exception build() {
> try {
> ...
> return record;
> } catch (Exception e) { //boom
> throw new org.apache.avro.AvroRuntimeException(e);
> }
> }
> {code}
> which fails to compile because Exception refers to the generated class (which does not extend Throwable)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)