myanmarking
01/07/2019, 5:44 PMmainScope.launch {
try{
val attr1 = async(<http://dispatchers.IO|dispatchers.IO>) { networkUser.setUserAttrs(userId, mappedServerData.weight).blockingFirst() }catch(){} }
zak.taccardi
01/07/2019, 5:46 PMbdawg.io
01/07/2019, 6:53 PMasync
function if the provided block throws an exception. You need to wrap your .await()
call. val attr1Async = async(IO) { ....blockingFirst() }
try {
attr1Async.await()
} catch (...) {
...
}
myanmarking
01/07/2019, 6:54 PM