Browse Source

REPORT-42604 直接连远程目录启动时 校验失败 未有提示弹窗

feature/big-screen
hades 4 years ago
parent
commit
6443d80345
  1. 4
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 9
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

4
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -182,7 +182,7 @@ public class EnvChangeEntrance {
return true; return true;
} }
private void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) { public void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) {
TestConnectionResult result = TestConnectionResult.parseByException(e); TestConnectionResult result = TestConnectionResult.parseByException(e);
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (ComparatorUtils.equals(result, TestConnectionResult.AUTH_FAILED)) { if (ComparatorUtils.equals(result, TestConnectionResult.AUTH_FAILED)) {
@ -493,7 +493,7 @@ public class EnvChangeEntrance {
/** /**
* 提示显示策略 * 提示显示策略
*/ */
enum PopTipStrategy { public enum PopTipStrategy {
/** /**
* 切换失败就马上提示失败不关闭选择列表对话框 * 切换失败就马上提示失败不关闭选择列表对话框

9
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -16,6 +16,7 @@ import com.fr.stable.StringUtils;
import com.fr.value.NotNullLazyValue; import com.fr.value.NotNullLazyValue;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.engine.exception.WorkspaceCheckException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -43,10 +44,10 @@ public class DesignerWorkspaceProvider extends Activator {
if (startupArgs.getValue().isDemo()) { if (startupArgs.getValue().isDemo()) {
DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
} else { } else {
String workspacePath;
DesignerWorkspaceInfo workspaceInfo = null;
try { try {
String current = DesignerEnvManager.getEnvManager().getCurEnvName(); String current = DesignerEnvManager.getEnvManager().getCurEnvName();
String workspacePath;
DesignerWorkspaceInfo workspaceInfo;
if (StringUtils.isNotEmpty(workspacePath = System.getProperty(SPECIFY_WORKSPACE))) { if (StringUtils.isNotEmpty(workspacePath = System.getProperty(SPECIFY_WORKSPACE))) {
workspaceInfo = LocalDesignerWorkspaceInfo.create(StringUtils.EMPTY, workspacePath); workspaceInfo = LocalDesignerWorkspaceInfo.create(StringUtils.EMPTY, workspacePath);
} else { } else {
@ -73,6 +74,10 @@ public class DesignerWorkspaceProvider extends Activator {
} }
} catch (Throwable e) { } catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (e.getCause() instanceof WorkspaceCheckException && workspaceInfo != null) {
WorkspaceCheckException exception = (WorkspaceCheckException) e.getCause();
EnvChangeEntrance.getInstance().handleWorkspaceCheckException(exception, EnvChangeEntrance.PopTipStrategy.LATER, workspaceInfo.getConnection());
}
EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner();
} }
} }

Loading…
Cancel
Save