fix: removing modpack with incomplete installation

This commit is contained in:
huanghongxun 2020-02-19 22:50:48 +08:00
parent 3269841207
commit cd9180c69a
3 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ public abstract class VersionList<T extends RemoteVersion> {
}
public Task<?> loadAsync(String gameVersion) {
return Task.composeAsync(() -> {
return Task.composeAsync(null, () -> {
lock.readLock().lock();
boolean loaded;

View File

@ -143,7 +143,7 @@ public class CancellableTaskExecutor extends TaskExecutor {
.findAny().orElse(null);
if (!doDependentsSucceeded && task.isRelyingOnDependents() || cancelled.get()) {
task.setException(dependentsException);
throw new CancellationException();
throw new ExecutionException(dependentsException);
}
if (doDependentsSucceeded)
@ -183,7 +183,7 @@ public class CancellableTaskExecutor extends TaskExecutor {
if (!doDependenciesSucceeded && task.isRelyingOnDependencies()) {
Logging.LOG.severe("Subtasks failed for " + task.getName());
task.setException(dependenciesException);
throw new CancellationException();
throw new ExecutionException(dependenciesException);
}
flag = true;

View File

@ -211,7 +211,7 @@ public class FileDownloadTask extends Task<Void> {
Exception exception = null;
for (int repeat = 0; repeat < retry * urls.size(); repeat++) {
URL url = urls.get(repeat / urls.size());
URL url = urls.get(repeat / retry);
if (isCancelled()) {
break;
}