Tools.isCause(Class<? extends Throwable> possibleExceptionCause, Throwable exceptionToSearch) 方法

定义

Checks if the provided exception contains a certain type of exception in its cause chain

public static boolean isCause(Class<? extends Throwable> possibleExceptionCause, Throwable exceptionToSearch)

参数

possibleExceptionCause
Class<? extends Throwable>

the type of exception to be searched for

exceptionToSearch
Throwable

the exception to search the stacktrace of

返回

boolean

if any variant of the possibleExceptionCause is found at any depth of the exception cause chain

适用于