|
|
@ -5,6 +5,7 @@ import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
|
|
|
import com.fr.env.RemoteWorkspaceURL; |
|
|
|
import com.fr.env.handler.impl.CancelHandler; |
|
|
|
import com.fr.env.handler.impl.CancelHandler; |
|
|
|
import com.fr.env.handler.impl.CommonHandler; |
|
|
|
import com.fr.env.handler.impl.CommonHandler; |
|
|
|
import com.fr.env.handler.impl.ExecutionHandler; |
|
|
|
import com.fr.env.handler.impl.ExecutionHandler; |
|
|
@ -30,9 +31,9 @@ public class RemoteDesignExceptionHandler { |
|
|
|
return INSTANCE; |
|
|
|
return INSTANCE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private final List<Handler<Throwable, ResultWrapper>> testList = new ArrayList<>(); |
|
|
|
private final List<Handler<RefWrapper, ResultWrapper>> testList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
private final List<Handler<Throwable, ResultWrapper>> switchList = new ArrayList<>(); |
|
|
|
private final List<Handler<RefWrapper, ResultWrapper>> switchList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
private RemoteDesignExceptionHandler() { |
|
|
|
private RemoteDesignExceptionHandler() { |
|
|
|
// 要保证顺序
|
|
|
|
// 要保证顺序
|
|
|
@ -47,11 +48,12 @@ public class RemoteDesignExceptionHandler { |
|
|
|
switchList.add(new CommonHandler(true)); |
|
|
|
switchList.add(new CommonHandler(true)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void handle(Throwable e, List<Handler<Throwable, ResultWrapper>> list) { |
|
|
|
public void handle(Throwable e, List<Handler<RefWrapper, ResultWrapper>> list, DesignerWorkspaceInfo workspaceInfo) { |
|
|
|
Throwable throwable = e; |
|
|
|
Throwable throwable = e; |
|
|
|
ResultWrapper wrapper; |
|
|
|
ResultWrapper wrapper; |
|
|
|
for (Handler<Throwable, ResultWrapper> handler : list) { |
|
|
|
String link = workspaceInfo.getConnection().getUrl() + RemoteWorkspaceURL.SYSTEM_LOGIN_PATH; |
|
|
|
wrapper = handler.handle(throwable); |
|
|
|
for (Handler<RefWrapper, ResultWrapper> handler : list) { |
|
|
|
|
|
|
|
wrapper = handler.handle(new RefWrapper(throwable, link)); |
|
|
|
throwable = wrapper.getThrowable(); |
|
|
|
throwable = wrapper.getThrowable(); |
|
|
|
if (!wrapper.isNext()) { |
|
|
|
if (!wrapper.isNext()) { |
|
|
|
break; |
|
|
|
break; |
|
|
@ -70,7 +72,7 @@ public class RemoteDesignExceptionHandler { |
|
|
|
UIManager.getIcon("OptionPane.errorIcon")); |
|
|
|
UIManager.getIcon("OptionPane.errorIcon")); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
handle(e, switchList); |
|
|
|
handle(e, switchList, workspaceInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void handleInStart(Throwable e, DesignerWorkspaceInfo workspaceInfo) { |
|
|
|
public void handleInStart(Throwable e, DesignerWorkspaceInfo workspaceInfo) { |
|
|
@ -78,11 +80,11 @@ public class RemoteDesignExceptionHandler { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
handle(e, testList); |
|
|
|
handle(e, testList, workspaceInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void handleInTest(Throwable e) { |
|
|
|
public void handleInTest(Throwable e, DesignerWorkspaceInfo workspaceInfo) { |
|
|
|
handle(e, testList); |
|
|
|
handle(e, testList, workspaceInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|