This certainly works, but is slightly less efficient as the caught exception is explicit to the jvm (so a non-processed exception will not be caught and rethrown which would be the corollary of your solution)
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
How to catch non kotlin exception? | 14 | 5683 | June 11, 2018 | |
Exceptions, Throwables, Errors, which course to take?
|
3 | 8766 | October 1, 2019 | |
An alternative to checked exceptions (that actually works for catching bugs) | 22 | 3760 | December 14, 2024 | |
Reviving Checked exceptions | 28 | 1927 | July 22, 2024 | |
Concise way to manage resource with exception in kotlin | 11 | 10445 | December 5, 2017 |