suspendedTryCatchNull
inline suspend fun <T> suspendedTryCatchNull(context: CoroutineContext = Dispatchers.Default, crossinline block: suspend () -> T): T?
suspendedTryCatchNull used when you want to return null if an exception is thrown in suspend functions.
Example:
suspend fun foo() = suspendedTryCatchNull {
// do something to return a value
}
Content copied to clipboard
Since
1.2.0