异常类优化调整

This commit is contained in:
tianliyong 2023-04-07 16:34:51 +08:00
parent f30e225a53
commit efb39fdc29

View File

@ -2,6 +2,7 @@ package cn.axzo.framework.domain.web;
import cn.axzo.framework.core.enums.ErrorLevel;
import cn.axzo.framework.core.enums.ErrorType;
import cn.axzo.framework.core.util.StringUtil;
import cn.axzo.framework.domain.web.code.IRespCode;
import lombok.Getter;
@ -30,11 +31,11 @@ public class BizException extends RuntimeException {
}
public BizException(ErrorLevel errorLevel, ErrorType errorType, IRespCode code, Object... args) {
this(errorLevel, errorType, code, null, args);
this(errorLevel, errorType, code, "", args);
}
public BizException(ErrorLevel errorLevel, ErrorType errorType, IRespCode code, String message, Object... args) {
super(format(message == null ? code.getMessage() : message, args));
super(format(StringUtil.isEmpty(message) ? code.getMessage() : message, args));
this.code = code.getRespCode();
this.errorLevel = errorLevel.getValue();
this.errorType = errorType.getValue();