From bfc1f47a0600e75ba5ce906c5c5097b3da30217d Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Tue, 19 Oct 2021 09:43:00 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-8509=20fix:=20=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=90=91=E5=AF=BC=E9=87=8D=E6=9E=84=E5=AF=BC=E8=87=B4=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=A4=B1=E8=B4=A5=E3=80=82=E8=BF=99=E9=87=8C=E9=80=82?= =?UTF-8?q?=E9=85=8D=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/LifecycleFatalErrorHandler.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java index a59d15faf..446253e90 100644 --- a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java +++ b/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.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; -import com.fr.process.ProcessEventPipe; import com.fr.process.engine.core.CarryMessageEvent; import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StableUtils; import com.fr.stable.lifecycle.ErrorType; +import com.fr.stable.lifecycle.ErrorTypeHelper; import com.fr.stable.lifecycle.FineLifecycleFatalError; import com.fr.stable.project.ProjectConstants; @@ -34,13 +34,7 @@ public class LifecycleFatalErrorHandler { private Map map = new HashMap<>(); private LifecycleFatalErrorHandler() { - for (ErrorType type : ErrorType.values()) { - if (ErrorType.FINEDB.equals(type)) { - map.put(type, FineDBHandler.SELF); - } else { - map.put(type, DefaultHandler.SELF); - } - } + map.put(ErrorTypeHelper.FINEDB, FineDBHandler.SELF); } public static LifecycleFatalErrorHandler getInstance() { @@ -50,7 +44,12 @@ public class LifecycleFatalErrorHandler { public void handle(FineLifecycleFatalError fatal) { SplashContext.getInstance().hide(); 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 {