package com.czg.exception;

import com.czg.resp.CzgRespCode;

import java.io.Serial;

/**
 * 自定义异常
 *
 * @author admin admin@cashier.com
 * @since 1.0.0
 */
public class CzgException extends RuntimeException {
	@Serial
	private static final long serialVersionUID = 1L;

    private int code;
	private String msg;

	public CzgException(String msg) {
		super(msg);
		this.code = CzgRespCode.FAILURE.getCode();
		this.msg = msg;
	}

	public CzgException(String msg, Throwable e) {
		super(msg, e);
		this.code = CzgRespCode.FAILURE.getCode();
		this.msg = msg;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

}