Browse Source

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

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '6443d803453711b228a52aa0c6dcefdba848ecbc':
  REPORT-42604 直接连远程目录启动时 校验失败 未有提示弹窗
feature/big-screen
Hades 4 years ago
parent
commit
dccdc05b9c
  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;
}
private void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) {
public void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) {
TestConnectionResult result = TestConnectionResult.parseByException(e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
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.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.engine.exception.WorkspaceCheckException;
import org.jetbrains.annotations.NotNull;
@ -43,10 +44,10 @@ public class DesignerWorkspaceProvider extends Activator {
if (startupArgs.getValue().isDemo()) {
DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
} else {
String workspacePath;
DesignerWorkspaceInfo workspaceInfo = null;
try {
String current = DesignerEnvManager.getEnvManager().getCurEnvName();
String workspacePath;
DesignerWorkspaceInfo workspaceInfo;
if (StringUtils.isNotEmpty(workspacePath = System.getProperty(SPECIFY_WORKSPACE))) {
workspaceInfo = LocalDesignerWorkspaceInfo.create(StringUtils.EMPTY, workspacePath);
} else {
@ -73,6 +74,10 @@ public class DesignerWorkspaceProvider extends Activator {
}
} catch (Throwable 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();
}
}

Loading…
Cancel
Save