package com.mtcarpenter.mall.common.exception;


import com.mtcarpenter.mall.common.util.ResultEnum;

/**
 * @author qiubo
 */
public class GlobalException extends RuntimeException {


    private Integer code;

    public GlobalException(String errorMessage) {
        super(errorMessage);
    }

    public GlobalException(Integer code, String msg) {
        this(msg);
        this.setCode(code);
    }

    public GlobalException(ResultEnum resultEnum) {
        this(resultEnum.getMsg());
        this.setCode(resultEnum.getCode());
    }


    public Integer getCode() {
        return code;
    }

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