Is it possible to catch exceptions if they are not...
# getting-started
m
Is it possible to catch exceptions if they are not of a certain type?
r
Copy code
catch (e: CertainType) {
    // Do nothing
} catch (e: Throwable) {
    ...
}
m
Thank you!
e
I would argue that
Copy code
} catch (e: CertainType) {
    throw e
} catch (e: Throwable) {
    ...
}
is more likely to be the right thing to do (for propagating CancellationException, InterruptedException, OutOfMemoryError, etc.)
4
👍 1