java.lang.Object
cn.wjybxx.base.ex.ExceptionUtils
异常工具类
这里部分修改在Commons-Lang3,为避免依赖,我们选择拷贝代码。
我用的最多的就是rethrow(Throwable)...
- 作者:
- wjybxx date - 2024/1/3
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ThrowablegetRootCause(Throwable throwable) getThrowableList(Throwable throwable) static booleanstatic booleanisUnchecked(Throwable throwable) static <R> R抛出原始异常,消除编译时警告static <T extends Throwable>
TthrowUnchecked(T throwable) 如果异常是非受检异常,则直接抛出,否则返回异常对象。
-
构造器详细资料
-
ExceptionUtils
public ExceptionUtils()
-
-
方法详细资料
-
getRootCause
-
getThrowableList
-
rethrow
抛出原始异常,消除编译时警告- 类型参数:
R- 方法正常执行的返回值类型
-
throwUnchecked
如果异常是非受检异常,则直接抛出,否则返回异常对象。 -
isChecked
-
isUnchecked
-