mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-07 17:36:52 +08:00
Forbids interrupted exception shown
This commit is contained in:
parent
2efb5d7f8f
commit
55e7b8901a
@ -142,9 +142,12 @@ public final class LauncherHelper {
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
Platform.runLater(() -> {
|
||||
Controllers.dialog(I18nException.getStackTrace(executor.getLastException()),
|
||||
scriptFile == null ? Main.i18n("launch.failed") : Main.i18n("version.launch_script.failed"),
|
||||
MessageBox.ERROR_MESSAGE, Controllers::closeDialog);
|
||||
if (executor.getLastException() != null)
|
||||
Controllers.dialog(I18nException.getStackTrace(executor.getLastException()),
|
||||
scriptFile == null ? Main.i18n("launch.failed") : Main.i18n("version.launch_script.failed"),
|
||||
MessageBox.ERROR_MESSAGE, Controllers::closeDialog);
|
||||
else
|
||||
Controllers.closeDialog();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -95,7 +95,9 @@ public final class GetTask extends TaskResult<String> {
|
||||
while ((len = input.read(buf)) != -1) {
|
||||
baos.write(buf, 0, len);
|
||||
read += len;
|
||||
updateProgress(read, size);
|
||||
|
||||
if (size >= 0)
|
||||
updateProgress(read, size);
|
||||
|
||||
if (Thread.currentThread().isInterrupted())
|
||||
return;
|
||||
|
@ -184,7 +184,6 @@ public final class TaskExecutor {
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
if (task.getSignificance().shouldLog()) {
|
||||
lastException = e;
|
||||
Logging.LOG.log(Level.FINE, "Task aborted: " + task.getName());
|
||||
task.onDone().fireEvent(new TaskEvent(this, task, true));
|
||||
taskListeners.forEach(it -> it.onFailed(task, e));
|
||||
|
Loading…
Reference in New Issue
Block a user