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

rethrowRuntimeException

open static fun rethrowRuntimeException(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 a RuntimeException or Error if appropriate; otherwise, throws an UndeclaredThrowableException.

Parameters

ex - the exception to rethrow

Exceptions

RuntimeException - the rethrown exception