cn.followtry.validation.base.common.exception.BusinessException Maven / Gradle / Ivy
package cn.followtry.validation.base.common.exception;
/**
*
* @author liuxrb
* @author jingzz
*/
public class BusinessException extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = -1934407327912767401L;
private int errorCode; //错误代码
private String errorMessage; //错误详细信息
public BusinessException(){
super();
}
public BusinessException(int code, String message){
super(message);
this.errorCode = code;
this.errorMessage = message;
}
public BusinessException(int code, String message, Throwable throwable){
super(message, throwable);
this.errorCode = code;
this.errorMessage = message;
}
public BusinessException(ErrorCode errorCode) {
super(errorCode.getDescription());
this.errorCode = errorCode.getValue();
this.errorMessage = errorCode.getDescription();
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy