[ 
https://issues.apache.org/jira/browse/AVRO-2127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16360773#comment-16360773
 ] 

ASF GitHub Bot commented on AVRO-2127:
--------------------------------------

busbey commented on a change in pull request #273: AVRO-2127 Make 
InvalidAvroMagicException thrown if stream header is corrupted
URL: https://github.com/apache/avro/pull/273#discussion_r167560725
 
 

 ##########
 File path: 
lang/java/avro/src/main/java/org/apache/avro/file/DataFileStream.java
 ##########
 @@ -102,7 +102,7 @@ void initialize(InputStream in) throws IOException {
       throw new IOException("Not an Avro data file.", e);
 
 Review comment:
   Is there an analogous case here to the EOF above? If there weren't enough 
bytes in the stream for the magic check, right now here we throw a bare IOE, 
right?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>            Assignee: 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
(v7.6.3#76005)

Reply via email to