package com.cslg.ppa.common.exception;


import lombok.Getter;

/**
 * @ClassName
 * @Description 业务异常
 * @Version TODO
 **/
@Getter
public class BusinessException extends RuntimeException {

	private String errorCode;// 异常代码
	private String errorMessage;// 异常信息

	public BusinessException(String errorCode, String errorMessage) {
		super(errorMessage);
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public BusinessException(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;
	}


}
