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;