Skip to content

add handling of FileReader errors#438

Open
tirnak wants to merge 2 commits intoTTLabs:masterfrom
tirnak:master
Open

add handling of FileReader errors#438
tirnak wants to merge 2 commits intoTTLabs:masterfrom
tirnak:master

Conversation

@tirnak
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Collaborator

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

@tirnak
Copy link
Copy Markdown
Author

tirnak commented Sep 3, 2019

Test was added. Please, rereview.

@fahadm
Copy link
Copy Markdown

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
Copy Markdown

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.

4 participants