Browse Source

KERNEL-8509 fix: 部署向导重构导致打包失败。这里适配一下

feature/x
lidongy 3 years ago
parent
commit
bfc1f47a06
  1. 17
      designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java

17
designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java

@ -11,11 +11,11 @@ import com.fr.exit.DesignerExiter;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.io.utils.ResourceIOUtils; import com.fr.io.utils.ResourceIOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.process.ProcessEventPipe;
import com.fr.process.engine.core.CarryMessageEvent; import com.fr.process.engine.core.CarryMessageEvent;
import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessContext;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.lifecycle.ErrorType; import com.fr.stable.lifecycle.ErrorType;
import com.fr.stable.lifecycle.ErrorTypeHelper;
import com.fr.stable.lifecycle.FineLifecycleFatalError; import com.fr.stable.lifecycle.FineLifecycleFatalError;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -34,13 +34,7 @@ public class LifecycleFatalErrorHandler {
private Map<ErrorType, Handler> map = new HashMap<>(); private Map<ErrorType, Handler> map = new HashMap<>();
private LifecycleFatalErrorHandler() { private LifecycleFatalErrorHandler() {
for (ErrorType type : ErrorType.values()) { map.put(ErrorTypeHelper.FINEDB, FineDBHandler.SELF);
if (ErrorType.FINEDB.equals(type)) {
map.put(type, FineDBHandler.SELF);
} else {
map.put(type, DefaultHandler.SELF);
}
}
} }
public static LifecycleFatalErrorHandler getInstance() { public static LifecycleFatalErrorHandler getInstance() {
@ -50,7 +44,12 @@ public class LifecycleFatalErrorHandler {
public void handle(FineLifecycleFatalError fatal) { public void handle(FineLifecycleFatalError fatal) {
SplashContext.getInstance().hide(); SplashContext.getInstance().hide();
FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue()));
map.get(fatal.getErrorType()).handle(fatal);
Handler handler = map.get(fatal.getErrorType());
if (handler == null) {
handler = DefaultHandler.SELF;
}
handler.handle(fatal);
} }
interface Handler { interface Handler {

Loading…
Cancel
Save