aeye-lab / pymovements

A python package for processing eye movement data
https://pymovements.readthedocs.io
MIT License
57 stars 11 forks source link

improve error in failed integrity check when downloading dataset resources #690

Open dkrako opened 4 months ago

dkrako commented 4 months ago

Description of the problem

In case of a failed integrity check in Dataset.load() we get a misleading error message:

RuntimeError: downloading resource tgd9q/ failed for all mirrors.

The original error message when failing download_file() is:

RuntimeError: File {filepath} not found or download corrupted.

Description of a solution

calling download_file() in download_dataset() can fail due to several reasons, but failing to download and failing to check integrity both result in a RuntimeError.

By raising a different type of exception on failing integrity checking, this could be handled better.

An alternative without changing download_file() would be to forward the error message from download_file() somehow. This would probably be the best solution.

Minimum acceptance criteria