1、首先自定义异常

spring异常+自定义以及使用

DataException:

package com.wbg.maven1128.exception;

public class DataException extends Exception {
    public DataException(){

    }
    public DataException(String msg){
            super(msg);
    }
}
View Code

相关文章: