You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/04 13:47:18 UTC

[GitHub] [commons-io] garydgregory commented on pull request #181: IO-696: Fix IOUtils.toByteArray exception

garydgregory commented on pull request #181:
URL: https://github.com/apache/commons-io/pull/181#issuecomment-753983815


   Hi @abchaubey 
   Thank you for your PR.
   I think we need to consider taking a look at all of Commons IO and consider if this is a task we want to do consistently: When do we throw an IOException vs IllegalArgumentException vs IllegalStateException vs UnsupportedOperationException and so on. 
   So IOW, let's pause and all think about this instead of doing a one-off PR here...
   This case in particular is interesting because the exception is thrown because the expected input does not match the actual file, so either the input is wrong (IAE) OR something went wrong while reading the file (IOEx). So either might be OK here. One general rule could be that IOEx all come from the JRE... needs further thought...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org