All Downloads are FREE. Search and download functionalities are using the official Maven repository.

matrix.boot.common.exception.BusinessException Maven / Gradle / Ivy

There is a newer version: 2.1.11
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy