[ 
https://issues.apache.org/jira/browse/AVRO-2127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitrii Bundin updated AVRO-2127:
---------------------------------
    Description: 
Curently we have IOException thrown if an avro file has incorrect magic. 

It seems reasonable to throw a subclass of IOException to be able to handle 
incorrect magic (in case length are match) in user code.

  was:
Curently we have IOException thrown if an avro file has incorrect magic. For 
example in case of empty avro file we have in DataFileStream#initialize

{code:java}
catch (IOException e) {
      throw new IOException("Not an Avro data file.");
    }
{code}

Therefore we lose EOFException being caught here. It also seems reasonable to 
throw a subclass of IOException to be able to handle incorrect magic (in case 
length are match) in user code.


> Throwing more specific exception if an avro file has currupted magic
> --------------------------------------------------------------------
>
>                 Key: AVRO-2127
>                 URL: https://issues.apache.org/jira/browse/AVRO-2127
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Dmitrii Bundin
>            Priority: Minor
>
> Curently we have IOException thrown if an avro file has incorrect magic. 
> It seems reasonable to throw a subclass of IOException to be able to handle 
> incorrect magic (in case length are match) in user code.



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

Reply via email to