Aslam Hossin
08/01/2019, 4:20 PMzak.taccardi
08/01/2019, 4:21 PMMark Murphy
08/01/2019, 4:23 PMsuspend
functions just throw ordinary exceptions, and you catch them using standard Kotlin `try`/`catch` when you call the suspend
functionsAslam Hossin
08/01/2019, 4:24 PMIlmir Usmanov [JB]
08/01/2019, 4:25 PMrunCatching { ... }.onFailure { ... }
gildor
08/01/2019, 4:26 PMgildor
08/01/2019, 4:26 PMJoaquim Ley
08/01/2019, 4:28 PMAslam Hossin
08/01/2019, 4:31 PMDico
08/01/2019, 6:14 PMinline fun handleErrors(block: () -> Unit) = try {
block()
} catch(ex: MyError) {
handleError(ex)
}
Marcelo Hernandez
08/01/2019, 6:17 PMThrowable
also catches the CancellationException
which typically should be propagated as part of the Coroutines cancellation mechanics.Marcelo Hernandez
08/01/2019, 6:18 PMonError
when disposing an active Single
.Marcelo Hernandez
08/01/2019, 6:19 PMZach Klippenstein (he/him) [MOD]
08/01/2019, 6:40 PMcatch
operator:
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/catch.htmlZach Klippenstein (he/him) [MOD]
08/01/2019, 6:41 PMonCompletion
might come in handy too if you need finally
semantics:
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/on-completion.htmlMark Murphy
08/01/2019, 6:41 PMFlow
Zach Klippenstein (he/him) [MOD]
08/01/2019, 6:42 PMgildor
08/02/2019, 12:27 AMI want to add a compose for handling all error from one method than using `try`/`catch`.Why you cannot do this with try /catch?
Aslam Hossin
08/02/2019, 3:06 AMgildor
08/02/2019, 3:13 AMgildor
08/02/2019, 3:14 AMgildor
08/02/2019, 3:14 AMAslam Hossin
08/02/2019, 3:18 AMAslam Hossin
08/02/2019, 3:25 AMgildor
08/02/2019, 3:27 AMgildor
08/02/2019, 3:28 AMgildor
08/02/2019, 3:29 AMgildor
08/02/2019, 3:30 AMAslam Hossin
08/02/2019, 3:32 AMZach Klippenstein (he/him) [MOD]
08/02/2019, 6:13 PM