spring boot全局异常处理
1、通过intellij idea创建spring boot项目,如下图所示

3、创建一个测试controller方法,然后返回异常,代码如下@RestController@RequestMapping("/test")public class TestController { @RequestMapping("") public Map test(@RequestBody Map map) throws Exception { if (1==1){ throw new Exception("1111111111"); } return map; }}

5、启动程序,访问rest接口
