public class ExceptionUtils extends Object
| 构造器和说明 |
|---|
ExceptionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getErrorMessageWithNestedException(Throwable ex)
获取组合本异常信息与底层异常信息的异常描述, 适用于本异常为统一包装异常类,底层异常才是根本原因的情况。
|
static Throwable |
getRootCause(Throwable ex)
获取异常的Root Cause.
|
static String |
getStackTraceAsString(Throwable ex)
将ErrorStack转化为String.
|
static boolean |
isCausedBy(Exception ex,
Class<? extends Exception>... causeExceptionClasses)
判断异常是否由某些底层的异常引起.
|
static RuntimeException |
unchecked(Throwable ex)
将CheckedException转换为UncheckedException.
|
public static RuntimeException unchecked(Throwable ex)
ex - 异常public static String getStackTraceAsString(Throwable ex)
ex - 异常public static String getErrorMessageWithNestedException(Throwable ex)
ex - 异常public static Throwable getRootCause(Throwable ex)
ex - 异常Copyright © 2019. All rights reserved.