You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Sebastien Dubois (JIRA)" <ji...@apache.org> on 2017/12/26 01:29:03 UTC

[jira] [Created] (AVRO-2121) GenericDatumWriter#writeWithoutConversion throws NullPointerException

Sebastien Dubois created AVRO-2121:
--------------------------------------

             Summary: GenericDatumWriter#writeWithoutConversion throws NullPointerException
                 Key: AVRO-2121
                 URL: https://issues.apache.org/jira/browse/AVRO-2121
             Project: Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.8.2
            Reporter: Sebastien Dubois
            Priority: Minor


Currently, GenericDatumWriter#writeWithoutConversion throws an NPE if some field is not defined as it should according to the schema.

I guess this is a matter of test, but as API client I'd like to rather get back an Avro-specific (runtime) exception (e.g., AvroWriteException), even if it wraps around an NPE. This makes it much more natural for writing libraries around.

With the code as it stands, my only choice to handle this would be to try/catch(npe), which doesn't feel great.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)