mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-02-05 16:44:47 +08:00
fix: recognizing CancellationException as crash
This commit is contained in:
parent
a162828f0a
commit
1b466eb33f
@ -108,6 +108,8 @@ public final class TaskExecutor {
|
||||
throw new IllegalStateException("Cannot cancel a not started TaskExecutor");
|
||||
}
|
||||
|
||||
Logging.LOG.log(Level.INFO, "Cancelling task " + firstTask);
|
||||
|
||||
cancelled.set(true);
|
||||
future.cancel(true);
|
||||
}
|
||||
@ -132,9 +134,6 @@ public final class TaskExecutor {
|
||||
.thenApplyAsync(unused -> (Exception) null)
|
||||
.exceptionally(throwable -> {
|
||||
Throwable resolved = resolveException(throwable);
|
||||
if (resolved instanceof CancellationException) {
|
||||
throw (CancellationException)resolved;
|
||||
}
|
||||
if (resolved instanceof Exception) {
|
||||
return (Exception) resolved;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user