~/talk

Why exception handling with Kotlin Coroutines is so hard, how to master it!

Talkat AppsFest 2020 · 2020-10-30..10-31· [kotlin, concurrency]
links:none on file
slides:none on file

Kotlin coroutines propagate uncaught exceptions up the Job hierarchy so installing a CoroutineExceptionHandler at root only catches failures; catching inside a child coroutine prevents propagation and can hide errors or stop sibling cancellation (e.g., two async network calls where catching the first lets the second continue and wastes work). async exceptions are captured in a Deferred and rethrow on await — async exceptions live in Deferred — and supervisorScope isolates failures to its supervisor job, so always rethrow CancellationException when you intend cancellation to stop execution.

AI-written summary · about

  1. 0:00Introduction
  2. 2:11Why exception handling is hard
  3. 7:59Structured concurrency and job hierarchy
  4. 10:08Coroutine exception handler
  5. 14:47Try-catch vs exception handler
  6. 16:56Cancellation and recovery
  7. 20:48Async vs launch behavior
  8. 26:58Scoping functions
  9. 32:58Recap and key points
  10. 36:52Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.