From b815ee037447f8719c7f57a3a0a3ca3c3c71e73a Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Wed, 10 May 2023 10:07:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/common/exception/ServiceException.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServiceException.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServiceException.java index 5c6967e2f..02dc242a7 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServiceException.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ServiceException.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.framework.common.exception; +import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.exception.enums.ServiceErrorCodeRange; import lombok.Data; import lombok.EqualsAndHashCode; @@ -32,7 +33,10 @@ public final class ServiceException extends RuntimeException { this.code = errorCode.getCode(); this.message = errorCode.getMsg(); } - + public ServiceException( String message) { + this.code = GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(); + this.message = message; + } public ServiceException(Integer code, String message) { this.code = code; this.message = message;