To mimic multi-catch the else branch should rethrow the exception.
try {
...
} catch (e: Exception) {
when(e) {
is SomeException, is OtherException -> {...}
else -> throw e
}
}
To mimic multi-catch the else branch should rethrow the exception.
try {
...
} catch (e: Exception) {
when(e) {
is SomeException, is OtherException -> {...}
else -> throw e
}
}