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

add handling of FileReader errors #438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tirnak
Copy link

@tirnak tirnak commented Aug 30, 2019

While using the library, it was noticed that error of FileReader is not propagated and just being swallowed. The error can be - problem with permissions, network issues, any kind of IO, basically.

This change propagates the error to the error callback of evaporate.add(...)

@jakubzitny
Copy link
Collaborator

Thanks @tirnak, the change makes sense, I'll try to test it, merge and release soon.

Can you please add a test case for such error as well? The test should fail without your change and pass with the change.

@fahadm
Copy link

fahadm commented Sep 1, 2019

Great catch, I was looking into this too after your PR, and I guess you should use the error handler so that it cleans up properly and prevents it from calling md5 calculation method with null.

Here's a diff (in gist) that might help.

https://gist.github.com/fahadm/d9cbea70d71f0860d04dde1d8d670372

@jakubzitny
Copy link
Collaborator

How about adding some tests and submitting another PR @fahadm? 😇

@tirnak
Copy link
Author

tirnak commented Sep 3, 2019

Test was added. Please, rereview.

@fahadm
Copy link

fahadm commented Sep 3, 2019

Great test case! I wasn't for the life of me was able to figure out, how to write a proper test case for this case.

@jakubzitny Rather than opening a new PR I would vouch for this PR.

@hhiptmair
Copy link

Hi! Any chance to get this merged? :) I think it's a good fix.

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

Successfully merging this pull request may close these issues.

None yet

4 participants