spring-framework / org.springframework.util / ReflectionUtils / rethrowException

rethrowException

open static fun rethrowException(ex: Throwable): Unit

Rethrow the given Throwable, which is presumably the target exception of an InvocationTargetException. Should only be called if no checked exception is expected to be thrown by the target method.

Rethrows the underlying exception cast to an Exception or Error if appropriate; otherwise, throws an UndeclaredThrowableException.

Parameters

ex - the exception to rethrow

Exceptions

Exception - the rethrown exception (in case of a checked exception)