-
Notifications
You must be signed in to change notification settings - Fork 9
catch in ExceptionHandler require class equality #13
Copy link
Copy link
Closed
Description
If we use this code:
exceptionHandler.handle {
request()
}.catch<Exception> {
false
}.execute()
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)
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working