Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException while reading fetch.txt #92

Closed
rvanheest opened this issue Jun 27, 2017 · 4 comments
Closed

ArrayIndexOutOfBoundsException while reading fetch.txt #92

rvanheest opened this issue Jun 27, 2017 · 4 comments
Labels

Comments

@rvanheest
Copy link

We've started to switch from v4 to v5 and so far it has been a great joy! I especially like the extended error messages for errors in the input regarding (for example bagit.txt and bag-info.txt). These error messages really help to see what went wrong while reading a bag. However, I'm missing this feature for fetch.txt.

Here's the situation: one of our test-bags has an extra newline at the end of the fetch.txt file. Because of this, the FetchReader fails at line 55, since the array that was filled in the previous line does not contain any items. It would be great if you could catch the exception in this part of the reader and return a similarly nice looking error message as referred to above.

@johnscancella
Copy link
Contributor

I just tested it with a file that contains a newline and it worked correctly. Are you sure there isn't some whitespace (like a space or a tab) on that line? Also what system are you running on?

@rvanheest
Copy link
Author

An example can be found here: fetch.txt. This file has an empty line at the end. The same happens when you add a newline in the middle of the file.

Full disclosure: the change in it's context can be found here.

Btw. I'm running on mac/unix.

@johnscancella
Copy link
Contributor

This will be in release 5.0.1

@rvanheest
Copy link
Author

Looks great! Added one comment to your commit.

Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants