JAVA自建项目异常类

通常情况下,我们进行项目开发过程中,项目本身在执行过程中会遇到一些可预知的报错,这些报错通常

用来收集业务相关报错;否则报错为Exception

/**
 * 系统自定义异常
 * 
 * @author Lbg/2017-11-22
 */
public class JwmsException extends RuntimeException {

    private static final long serialVersionUID = -4121183247868094927L;
    private String extra; 

    public JwmsException() {
        super();
    }

    /**
     * @param msg 异常信息
     */
    public JwmsException(String msg) {
        super(msg);
    }

    public JwmsException(String msg, String extra) {
        super(msg);
        this.extra = extra;
    }

    /**
     * @param e 异常
     */
    public JwmsException(Throwable e) {
        super(e);
    }

    /**
     * @param msg 异常信息
     * @param e 异常
     */
    public JwmsException(String msg, Throwable e) {
        super(msg, e);
    }

    /**
     * 获得 extra
     */
    public String getExtra() {
        return extra;
    }

    /**
     * 设置 extra
     */
    public void setExtra(String extra) {
        this.extra = extra;
    }
}

posted @ 2017-11-22 14:42  林中白狼-LBG  阅读(181)  评论(0编辑  收藏  举报