package com.jd.platform.hotkey.dashboard.common.ex;


import com.jd.platform.hotkey.dashboard.common.eunm.ResultEnum;

public class BizException extends RuntimeException {

    private int code;
    private String message;

    public BizException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizException(ResultEnum result) {
        this.code = result.getCode();
        this.message = result.getMsg();
    }

    public int getCode() {
        return code;
    }

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

    @Override
    public String getMessage() {
        return message;
    }

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

    @Override
    public String toString() {
        return "BizException{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}