How to handle failed downloads?
-
If a download fails at some point, is it ok for me to call:
if (this.data.finished && this.data.success == false) { this.resume(); }
...or should I handle it in some other way? Ideally, I'd not throw an error at a user, but make another attempt at downloading the failed file again.
Thank you!
-
@tomekslesicki I think resume only works if the download has been stopped with
Download.stop()
I think if it fails you just need to restart it - and I think HISE will carry on from where it left off.
-
-
@tomekslesicki Yeah - try it and report back, and don't get stuck in an endless loop of failed downloads, give up after a few attempts.
In my downloader I give up after 1 attempt so I don't have to deal with it ;)