This commit is contained in:
Looly
2023-05-03 21:35:04 +08:00
parent 867ae94b74
commit b60393d9b2
2 changed files with 73 additions and 4 deletions

View File

@@ -421,12 +421,11 @@ public class ExceptionUtil {
* @return 最尾端异常传入null参数返回也为null
*/
public static Throwable getRootCause(final Throwable throwable) {
Throwable cause = throwable.getCause();
if (cause != null) {
return getRootCause(cause);
}else{
final Throwable cause = throwable.getCause();
if (null == cause) {
return throwable;
}
return getRootCause(cause);
}
/**