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 统一异常处理
- Host: GitHub
- URL: https://github.com/wangcaitao/wangcaitao-global-exception-handler
- Owner: wangcaitao
- License: apache-2.0
- Created: 2018-12-15T12:19:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-09T04:51:27.000Z (almost 5 years ago)
- Last Synced: 2025-01-22T01:13:51.135Z (5 months ago)
- Topics: exception-handler, spring-boot
- Language: Java
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`