package com.yunfeiyun.agmp.common.exception;

import com.yunfeiyun.agmp.common.constant.ErrorCode;

/**
 * 业务异常类
 * 
 * @author 杨晓辉
 */
public class BizException extends BaseException
{

    private String code;
    private String msg;
    private String detailMessage;
    private Object data;

    public BizException(String code,String msg)
    {
        super(code,msg,null);
        this.code = code;
        this.msg = msg;
    }

    public BizException(String code,String msg,Object data)
    {
        super(code,msg,null);
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public BizException(ErrorCode errorCode){
        super(errorCode);
    }

    public String getDetailMessage()
    {
        return detailMessage;
    }

    @Override
    public String getMsg()
    {
        return msg;
    }

    public String getCode()
    {
        return code;
    }

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

    public BizException setDetailMessage(String detailMessage)
    {
        this.detailMessage = detailMessage;
        return this;
    }
}
