From 6644ea9cc7e6c6ae791da2ef4ab9ff761bdb1363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cliuliaozhong=E2=80=9D?= Date: Wed, 1 Feb 2023 18:37:31 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BE=9D=E8=B5=96=E7=9A=84=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=B3=BB=E7=BB=9F=EF=BC=88CMDB=E3=80=81IAM=E7=AD=89?= =?UTF-8?q?=EF=BC=89=E6=8E=A5=E5=8F=A3=E5=BC=82=E5=B8=B8=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF=E4=BC=98=E5=8C=96=20#1430?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/exception/CmdbClientException.java | 30 ------------------- .../notify/impl/NotifyEsbChannelDAOImpl.java | 8 +---- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 src/backend/commons/common/src/main/java/com/tencent/bk/job/common/exception/CmdbClientException.java diff --git a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/exception/CmdbClientException.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/exception/CmdbClientException.java deleted file mode 100644 index 00dbeba625..0000000000 --- a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/exception/CmdbClientException.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.tencent.bk.job.common.exception; - -import com.tencent.bk.job.common.model.error.ErrorType; -import lombok.Getter; -import lombok.ToString; - -/** - * 内部服务异常--调用CMDB异常 - */ -@Getter -@ToString -public class CmdbClientException extends InternalException { - - public CmdbClientException(Throwable cause, Integer errorCode, Object[] errorParams) { - super(cause, errorCode, errorParams); - } - - public CmdbClientException(String message, Throwable cause, Integer errorCode) { - super(message, cause, errorCode); - } - - public CmdbClientException(String message, Integer errorCode) { - super(message, errorCode); - } - - public CmdbClientException(Integer errorCode, Object[] errorParams) { - super(errorCode, errorParams); - } - -} diff --git a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/dao/notify/impl/NotifyEsbChannelDAOImpl.java b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/dao/notify/impl/NotifyEsbChannelDAOImpl.java index 7e1406e9c5..edb1e4241d 100644 --- a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/dao/notify/impl/NotifyEsbChannelDAOImpl.java +++ b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/dao/notify/impl/NotifyEsbChannelDAOImpl.java @@ -30,7 +30,6 @@ import com.google.common.util.concurrent.UncheckedExecutionException; import com.tencent.bk.job.common.constant.ErrorCode; import com.tencent.bk.job.common.exception.InternalCmsiException; -import com.tencent.bk.job.common.exception.InternalException; import com.tencent.bk.job.common.util.JobContextUtil; import com.tencent.bk.job.manage.dao.notify.NotifyEsbChannelDAO; import com.tencent.bk.job.manage.model.dto.notify.NotifyEsbChannelDTO; @@ -98,12 +97,7 @@ public List listNotifyEsbChannel(DSLContext dslContext) { } catch (ExecutionException | UncheckedExecutionException e) { String errorMsg = "Fail to load EsbChannel from cache"; logger.error(errorMsg, e); - Throwable cause = e.getCause(); - if (cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } else { - throw new InternalCmsiException(errorMsg, e, ErrorCode.CMSI_MSG_CHANNEL_DATA_ERROR); - } + throw new InternalCmsiException(errorMsg, e, ErrorCode.CMSI_MSG_CHANNEL_DATA_ERROR); } } }