John Kramer
05/21/2025, 6:43 PMtry {
// 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?Youssef Shoaib [MOD]
05/21/2025, 6:51 PMJohn Kramer
05/21/2025, 7:13 PM