ifCausedBy

open fun <E : Exception?> ifCausedBy(ex: Exception, causedBy: Class<E>, action: Consumer<E>)

Perform an action if the given exception was caused by a specific exception type.

Since

2.2.7

Parameters

<E>

the cause exception type

ex

the source exception

causedBy

the required cause type

action

the action to perform