Hi all, I’m curious if and when Kotlin will suppor...
# compiler
j
Hi all, I’m curious if and when Kotlin will support the Java catch with pipe exception syntax? E.g.
Copy code
try {
    // Code that may throw IOException or SQLException
    ...
} catch (IOException | SQLException e) {
    // Handle both IOException and SQLException
}
I get that there are other ways to handle this, you can catch Exception or Throwable and then check types and throw if it doesn’t match, etc. But it’s ugly and boilerplate and isn’t that part of what Kotlin is supposed to improve?
j
Got it. Thanks!