自定义异常处理
1、搭建一个SpringBoot项目并在pom.xml中添加web启动即可<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>

3、新建一个异常处理器ControllerExceptionHandler

5、启动项目,开始测试


1、搭建一个SpringBoot项目并在pom.xml中添加web启动即可<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>
3、新建一个异常处理器ControllerExceptionHandler
5、启动项目,开始测试