com.imooc.test.DrunkException: 喝车别开酒
at com.imooc.test.ChainTest.test1(ChainTest.java:16)
at com.imooc.test.ChainTest.test2(ChainTest.java:21)
at com.imooc.test.ChainTest.main(ChainTest.java:9)
java.lang.RuntimeException: com.imooc.test.DrunkException: 喝车别开酒
at com.imooc.test.ChainTest.test2(ChainTest.java:25)
at com.imooc.test.ChainTest.main(ChainTest.java:9)
Caused by: com.imooc.test.DrunkException: 喝车别开酒
at com.imooc.test.ChainTest.test1(ChainTest.java:16)
at com.imooc.test.ChainTest.test2(ChainTest.java:21)
... 1 more
这是你自定义的异常啊,还是链式异常。根源就是Caused by:后面的引起了异常。
代码放出来看看