``` fun getErrorHandlerForException(ex: Exception)...
# getting-started
r
Copy code
fun getErrorHandlerForException(ex: Exception) = when(ex) {
    is IllegalArgumentException -> ::handleIAE
    is RuntimeException -> ::handleRE
    else -> null
}