Closed eriktack closed 8 months ago
Hi @eriktack, no problem if you have any questions feel free to ask.
the Downloader has an event named DownloadFileCompleted
which sends events of completion reasons to the handler. If your download has any error, this event sends an error message in arguments.
var downloader = new DownloadService ();
downloader.DownloadFileCompleted += OnDownloadFileCompleted;
private static void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
if (e.Cancelled)
{
// download canceled
}
else if (e.Error != null)
{
// Error occurred
}
else
{
// downloaded successfully
}
}
Maybe im too stupid to understand how this works, but if I use the DownloadService without any custom config on a url that return statuscode 404 like so: var service = new DownloadService (); await service.DownloadFileTaskAsync(url, tempFileName);
Then the downloader just saves a 0 byte file without giving any warning or error. this didnt used to happen with version 2.0.0, then I got an exception and could handle it.