Kris Wong
01/24/2020, 7:46 PMKris Wong
01/24/2020, 7:47 PMkpgalligan
01/24/2020, 8:04 PMKris Wong
01/24/2020, 8:14 PMKris Wong
01/24/2020, 8:15 PMKris Wong
01/24/2020, 8:18 PMkpgalligan
01/24/2020, 8:21 PMKris Wong
01/24/2020, 8:23 PMkpgalligan
01/24/2020, 8:26 PMKris Wong
01/24/2020, 8:43 PMKris Wong
01/24/2020, 8:43 PMKris Wong
01/24/2020, 8:44 PMkpgalligan
01/24/2020, 8:45 PMkpgalligan
01/24/2020, 8:46 PMKris Wong
01/24/2020, 8:46 PMkpgalligan
01/24/2020, 8:47 PMkpgalligan
01/24/2020, 8:47 PMinternal class MainScope(private val mainContext: CoroutineContext) : CoroutineScope {
override val coroutineContext: CoroutineContext
get() = mainContext + job + exceptionHandler
internal val job = Job()
private val exceptionHandler = CoroutineExceptionHandler { _, throwable ->
showError(throwable)
}
//TODO: Some way of exposing this to the caller without trapping a reference and freezing it.
fun showError(t: Throwable) {
printThrowable(t)
}
}
Kris Wong
01/24/2020, 8:48 PMkpgalligan
01/24/2020, 8:48 PMKris Wong
01/24/2020, 8:49 PMKris Wong
01/24/2020, 8:55 PMkpgalligan
01/24/2020, 8:55 PMKris Wong
01/24/2020, 8:55 PMKris Wong
01/24/2020, 8:56 PMKris Wong
01/24/2020, 8:59 PMkpgalligan
01/24/2020, 9:01 PMKris Wong
01/24/2020, 9:02 PMkpgalligan
01/24/2020, 9:02 PMKris Wong
01/24/2020, 9:03 PM