An open API service indexing awesome lists of open source software.

https://github.com/wangcaitao/wangcaitao-global-exception-handler

spring boot 统一异常处理
https://github.com/wangcaitao/wangcaitao-global-exception-handler

exception-handler spring-boot

Last synced: 3 months ago
JSON representation

spring boot 统一异常处理

Awesome Lists containing this project

README

        

# wangcaitao-global-exception-handler

spring boot 统一异常处理

## 使用

1. 添加依赖

```xml

com.wangcaitao
wangcaitao-global-exception-handler
2.1.3

```

1. 配置文件

```yaml
spring:
mvc:
throw-exception-if-no-handler-found: true
resources:
add-mappings: false
```

1. `@SpringBootApplication` 修改为 `@SpringBootApplication(scanBasePackages = {"com.wangcaitao.global", "com.xxx.xxx"})`, `com.xxx.xxx` 为启动类所在 `package`