Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.8.2
-
None
-
None
Description
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.
Debugging experience would also be improved if additional checks were implemented directly in writeWithoutConversion instead of letting the encoder implementations fail miserably because of null values