The only change is just `Exception e` -> `e: Ex...
# announcements
e
The only change is just
Exception e
->
e: Exception
s
And there's no multi-catch yet, right?
e
There is, you can have multiple catch block
m
Multi-catch usually refers to doing something like
e: Exception1 | Exception2
to avoid duplicating error handling logic in multiple catch blocks.
e
Well then there is not, cause this way e will have multiple types, which in Kotlin is not allowed yet
m
try { } catch(e: Exception) { when(e) { is TypeOne -> dosomething() is TypeTwo -> doAnotherthing() } }
This is how multicatch can be emulated.
s
Yeah, single
catch
-blocks with multiple typed was what I was referring to. simple smile
Using a
when
like that seems pointless. Then we could just have multiple
catch
blocks, since there's different logic applied for each type.