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