package cn.palmte.work.exception;

import cn.palmte.work.config.Constant;

/**
 * @author xiongshiyan
 * 使用的时候直接抛出异常ResponseException(如果想携带ResultCode,Message,Data等信息)
 */
public class ResponseException extends RuntimeException{
    private int status = Constant.Status.STATUS_FAILED;
    private Object data = null;

    public ResponseException(int resultCode, String message, Object data){
        super(message);
        this.status = resultCode;
        this.data = data;
    }
    public ResponseException(int status, String message){
        this(status, message, null);
    }
    public ResponseException(String message){
        super(message);
    }
    public int getStatus(){
        return status;
    }
    public void setStatus(int status){ this.status = status; }
    public Object getData(){
        return data;
    }
    public void setData(Object data){
        this.data = data;
    }
    
}