We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6326ce1 commit 9ed006fCopy full SHA for 9ed006f
README.md
@@ -1,5 +1,5 @@
1
## flylib-boot简介
2
-flylib-boot是针对springboot构建的程序的基础框架,专门用于构建程序里的比如统一
+flylib-boot是针对springboot构建的程序的基础框架,专门用于构建程序里的比如统一
3
异常处理
4
5
## 功能
@@ -69,3 +69,20 @@ flylib-boot是针对springboot构建的程序的基础框架,专门用于构
69
</project>
70
71
```
72
+
73
+捕获异常的实例
74
+```
75
+@RequestMapping("")
76
+ public String index() throws RuntimeException {
77
+ UserException userException = new UserException();
78
+ CustomRuntimeException cause = new CustomRuntimeException("001", "User not exists");
79
+ userException.initCause(cause);
80
+ throw userException;
81
+ }
82
83
+输出到浏览器的结果
84
85
+code:"001"
86
+message:"User not exists"
87
+throwable:{...}
88
0 commit comments