close #1791
close #1868
This commit is contained in:
Glavo 2022-11-26 21:43:03 +08:00 committed by GitHub
parent 8e28c2487f
commit a96fe298b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -277,9 +277,7 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
dependents = mods.stream()
.map(mod -> {
return Task
.runAsync(Schedulers.javafx(), () -> {
mod.getKey().setOld(true);
})
.runAsync(Schedulers.javafx(), () -> mod.getKey().setOld(true))
.thenComposeAsync(() -> {
FileDownloadTask task = new FileDownloadTask(
new URL(mod.getValue().getFile().getUrl()),
@ -326,6 +324,8 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
@Override
public void execute() throws Exception {
if (!isDependentsSucceeded())
throw getException();
}
}
}

View File

@ -709,7 +709,7 @@ public abstract class Task<T> {
@Override
public void execute() throws Exception {
if (isDependentsSucceeded() != (Task.this.getException() == null))
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.");
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.", Task.this.getException());
action.execute(Task.this.getException());