catch blog will not be execute if throw some of subclasses of Exception. it's imprudent behavior, because try-catch allow to catch all subclasses of some type. We should improve it to same logic.
to implement this i think we should remove KClass map and use lambda with conditions.
inline fun <reified E : Throwable> catch(noinline catcher: (E) -> Boolean)
become
inline fun <reified E : Throwable> catch(
noinline catcher: (E) -> Boolean
): ExceptionHandlerContext<R> {
return catch(condition = { it is E }, catcher = catcher)
}
If we use this code:
catch
blog will not be execute if throw some of subclasses ofException
. it's imprudent behavior, becausetry-catch
allow to catch all subclasses of some type. We should improve it to same logic.to implement this i think we should remove
KClass
map and use lambda with conditions.become