From 8b16e8be4de9e7c81d62cea2fa665d6b1bbac6fd Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Tue, 11 Feb 2020 13:12:36 +0800 Subject: [PATCH] fix: incorrect log in GetTask --- HMCLCore/src/main/java/org/jackhuang/hmcl/task/GetTask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/task/GetTask.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/task/GetTask.java index fc02aea5f..0c93d96d8 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/task/GetTask.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/task/GetTask.java @@ -82,6 +82,7 @@ public final class GetTask extends Task { @Override public void execute() throws Exception { Exception exception = null; + URL failedURL = null; boolean checkETag = true; for (int time = 0; time < retry; ++time) { URL url = urls.get(time % urls.size()); @@ -132,12 +133,13 @@ public final class GetTask extends Task { } return; } catch (IOException ex) { + failedURL = url; exception = ex; - Logging.LOG.log(Level.WARNING, "Failed to download " + url + ", repeat times: " + time + 1, ex); + Logging.LOG.log(Level.WARNING, "Failed to download " + url + ", repeat times: " + (time + 1), ex); } } if (exception != null) - throw new DownloadException(urls.get(0), exception); + throw new DownloadException(failedURL, exception); } }