novoda / download-manager

A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures
Apache License 2.0
483 stars 63 forks source link

DLM-483/FileDownloader Error Strong Typing #486

Closed Mecharyry closed 5 years ago

Mecharyry commented 5 years ago

⚠️ Against a feature branch to ensure we have addressed all of the issues outlined in #483 ⚠️

Problem

We need to introduce a better retry and failure mechanism when attempting to download a file. At the moment we only return a message associated with the failure from the FileDownloader which is not enough information to allow us or clients to perform any meaningful retrial / error flow.

Solution

Introduce a FileDownloader.FileDownloadError interface and an associated model that represents some additional data that is required in order to be able to perform meaningful error handling.

Not currently hooked up to any error handling, just passes the new model back to the DownloadBatch who then transforms it back to the old error. This will be used when we introduce the new error handling interface. See #483 for more information.