mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 07:16:27 -04:00
fix: incorrect log in GetTask
This commit is contained in:
parent
89dbc1be4a
commit
8b16e8be4d
@ -82,6 +82,7 @@ public final class GetTask extends Task<String> {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
|
URL failedURL = null;
|
||||||
boolean checkETag = true;
|
boolean checkETag = true;
|
||||||
for (int time = 0; time < retry; ++time) {
|
for (int time = 0; time < retry; ++time) {
|
||||||
URL url = urls.get(time % urls.size());
|
URL url = urls.get(time % urls.size());
|
||||||
@ -132,12 +133,13 @@ public final class GetTask extends Task<String> {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
failedURL = url;
|
||||||
exception = ex;
|
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)
|
if (exception != null)
|
||||||
throw new DownloadException(urls.get(0), exception);
|
throw new DownloadException(failedURL, exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user