异常类优化调整
This commit is contained in:
parent
f30e225a53
commit
efb39fdc29
@ -2,6 +2,7 @@ package cn.axzo.framework.domain.web;
|
|||||||
|
|
||||||
import cn.axzo.framework.core.enums.ErrorLevel;
|
import cn.axzo.framework.core.enums.ErrorLevel;
|
||||||
import cn.axzo.framework.core.enums.ErrorType;
|
import cn.axzo.framework.core.enums.ErrorType;
|
||||||
|
import cn.axzo.framework.core.util.StringUtil;
|
||||||
import cn.axzo.framework.domain.web.code.IRespCode;
|
import cn.axzo.framework.domain.web.code.IRespCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@ -30,11 +31,11 @@ public class BizException extends RuntimeException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BizException(ErrorLevel errorLevel, ErrorType errorType, IRespCode code, Object... args) {
|
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) {
|
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.code = code.getRespCode();
|
||||||
this.errorLevel = errorLevel.getValue();
|
this.errorLevel = errorLevel.getValue();
|
||||||
this.errorType = errorType.getValue();
|
this.errorType = errorType.getValue();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user