rethrowException

open fun rethrowException(@Nullable throwable: @Nullable Throwable)

Rethrow the given exception, 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

throwable

the exception to rethrow

Throws

the rethrown exception (in case of a checked exception)