package com.sifang.modules.sunshine.SystemSetting.utils;

public class CustomException extends Exception {

    private String code ;

    public String getCode() {
        return code;
    }

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

    //无参构造方法
    public CustomException(){

        super();
    }

    //有参的构造方法
    public CustomException(String message,String code){
        super(message);

    }

    // 用指定的详细信息和原因构造一个新的异常
    public CustomException(String message, Throwable cause){

        super(message,cause);
    }

    //用指定原因构造一个新的异常
    public CustomException(Throwable cause) {

        super(cause);
    }

    public static CustomException exce(String code ,String mes){
        CustomException exce = new CustomException();
        exce.setCode(code);
        return exce;
    }

}
