package com.trade.common.exception;

/** 验证数据异常 */
public class ValidatorException extends RuntimeException {


    private static final long serialVersionUID = 1L;
    /**
     * 错误码
     */
    private Integer code;
    /**
     * 错误提示
     */
    private String message;


    /**
     * 空构造方法，避免反序列化问题
     */
    public ValidatorException(){
    }

    public ValidatorException(String message){
        this.message = message;
    }

    public ValidatorException(Integer code,String message){
        this.message = message;
        this.code = code;
    }

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

    public Integer getCode() {
        return code;
    }

    public ValidatorException setMessage(String message) {
        this.message = message;
        return this;
    }

}
