package com.cslg.ppa.common.exception;

/**
 * 整个项目通用异常类
 *
 * @Author chenyu
 * @Data 2023/2/15
 */
public class XiaoShiException extends RuntimeException {

    private String errorCode;// 异常代码
    private String errorMessage;// 异常信息
    public XiaoShiException(String message) {
        super(message);
    }

    public XiaoShiException(ExceptionEnum e, String errorMessage) {
        super(errorMessage);
        this.errorCode = e.getCode();
        this.errorMessage = errorMessage;
    }

    public XiaoShiException(ExceptionEnum e) {
        super(e.getMessage());
        this.errorMessage = e.getMessage();
        this.errorCode = e.getCode();
    }


    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
