fix: wrong failure URL
This commit is contained in:
@@ -209,6 +209,7 @@ public class FileDownloadTask extends Task<Void> {
|
|||||||
|
|
||||||
Logging.LOG.log(Level.FINER, "Downloading " + urls.get(0) + " to " + file);
|
Logging.LOG.log(Level.FINER, "Downloading " + urls.get(0) + " to " + file);
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
|
URL failedURL = null;
|
||||||
|
|
||||||
for (int repeat = 0; repeat < retry * urls.size(); repeat++) {
|
for (int repeat = 0; repeat < retry * urls.size(); repeat++) {
|
||||||
URL url = urls.get(repeat / retry);
|
URL url = urls.get(repeat / retry);
|
||||||
@@ -325,6 +326,7 @@ public class FileDownloadTask extends Task<Void> {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (temp != null)
|
if (temp != null)
|
||||||
temp.toFile().delete();
|
temp.toFile().delete();
|
||||||
|
failedURL = url;
|
||||||
exception = e;
|
exception = e;
|
||||||
Logging.LOG.log(Level.WARNING, "Failed to download " + url + ", repeat times: " + (repeat + 1), e);
|
Logging.LOG.log(Level.WARNING, "Failed to download " + url + ", repeat times: " + (repeat + 1), e);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -333,7 +335,7 @@ public class FileDownloadTask extends Task<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw new DownloadException(urls.get(0), exception);
|
throw new DownloadException(failedURL, exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Timer timer = new Timer("DownloadSpeedRecorder", true);
|
private static final Timer timer = new Timer("DownloadSpeedRecorder", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user