package cn.sh.stc.sict.cloud.common.core.exception;


import cn.sh.stc.sict.cloud.common.core.constant.enums.BizCodeConstant;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @Description 200 业务异常处理
 * @Author
 * @Date
 */
@NoArgsConstructor
public class BusinessException extends Exception {
    private static final long serialVersionUID = 1L;
    @Getter
    @Setter
    private int code = 0;

    public BusinessException(String message) {
        super(message);
    }
    public BusinessException(int code, String message){
        super(message);
        this.code = code;
    }
    public BusinessException(BizCodeConstant biz){
        super(biz.getDescription());
        this.code = biz.getCode();
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
