declaresException

open fun declaresException(method: Method, exceptionType: Class<out Any>): Boolean

Determine whether the given method explicitly declares the given exception or one of its superclasses, which means that an exception of that type can be propagated as-is within a reflective invocation.

Return

true if the exception can be thrown as-is; false if it needs to be wrapped

Parameters

method

the declaring method

exceptionType

the exception to throw