springboot全局异常的处理@ControllerAdvice和@ExceptionHandler

在项目中,咱们常常遇到程序运行异常,也常常根据业务须要自定义异常,springboot给咱们提供了一种便利的方式捕获全局异常,解决访问url地址不友好提示的问题。html @RequestMapping("/error") public void error() throws HbkException { try { int a = 5/0;
相关文章
相关标签/搜索