Hi everyone! Is there any wrapper for `try { } cat...
# announcements
i
Hi everyone! Is there any wrapper for
try { } catch (e: Exception) { }
block that returns
null
on exception (in stdlib)? Something like
runCatching { }
, but without unwrapping.
r
What's wrong with
runCatching{ }.getOrNull()
, or an extension function that calls it if you really need it? It's a value class so it's not going to be very expensive. I don't know of any all-in-one functions that do that
d
Standard library doesn't have one.
i
👌