matrix.boot.common.exception.BusinessException Maven / Gradle / Ivy
package matrix.boot.common.exception;
/**
* 业务异常类(已知业务异常,不打印堆栈信息)
*
* @author wangcheng
* 2021/12/27
**/
public class BusinessException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* 错误编码
*/
private Integer errorCode;
public BusinessException() {
super();
}
public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public BusinessException(String message, Throwable cause) {
super(message, cause);
}
public BusinessException(String message) {
super(message);
}
public BusinessException(Throwable cause) {
super(cause.getMessage(), cause);
}
public Integer getErrorCode() {
return errorCode;
}
public BusinessException setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
return this;
}
}