Browse Source

REPORT-62576 【组件可更新提醒】组件复用-更新过程中取消更新失败

【问题原因】
未处理取消异常

【改动思路】
try-catch块中使用Exception匹配所有异常
feature/x
Starryi 3 years ago
parent
commit
0099f1f88e
  1. 13
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java

13
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java

@ -5,7 +5,6 @@ import com.fr.design.extra.Process;
import com.fr.design.login.DesignerLoginHelper;
import com.fr.design.login.DesignerLoginSource;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoUpdater;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane;
import com.fr.design.mainframe.share.util.DownloadUtils;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
@ -24,7 +23,6 @@ import java.awt.Component;
import java.awt.Container;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
/**
* @author Starryi
@ -107,7 +105,7 @@ public class LocalWidgetUpdater implements Process<Double> {
boolean success = false;
try {
success = get();
} catch (InterruptedException | ExecutionException e) {
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (success) {
@ -138,10 +136,11 @@ public class LocalWidgetUpdater implements Process<Double> {
}
public void cancelUpdate() {
if (worker.isDone() || worker.isCancelled()) {
return;
}
if (worker != null && !worker.isDone()) {
worker.cancel(true);
worker = null;
}
process(-1.0);
}
@ -152,7 +151,7 @@ public class LocalWidgetUpdater implements Process<Double> {
}
private void repaintBlockAndOverlay() {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
Container absoluteLayoutParent = getAbsoluteLayoutAncestor(widgetBlock);

Loading…
Cancel
Save