safelyWithoutExceptions

This commit is contained in:
InsanusMokrassar 2020-11-02 21:25:33 +06:00
parent 8495cc6263
commit 6f5c6e5ebe
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,9 @@
## 0.2.5 ## 0.2.5
* `Coroutines`
* Function `safelyWithoutExceptions`
## 0.2.4 ## 0.2.4
* `Versions` * `Versions`

View File

@ -21,3 +21,10 @@ suspend inline fun <T> safely(
onException(e) onException(e)
} }
} }
/**
* Shortcut for [safely] without exception handler (instead of this you will receive null as a result)
*/
suspend inline fun <T> safelyWithoutExceptions(
noinline block: suspend CoroutineScope.() -> T
): T? = safely({ null }, block)