Skip to content

Commit 5d16938

Browse files
SebastianAignerdkhalanskyjb
authored andcommitted
Update exception-handling.md (#3927)
1 parent ed0cf7a commit 5d16938

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/topics/exception-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,15 @@ fun main() = runBlocking {
306306
println("CoroutineExceptionHandler got $exception")
307307
}
308308
val job = GlobalScope.launch(handler) {
309-
val inner = launch { // all this stack of coroutines will get cancelled
309+
val innerJob = launch { // all this stack of coroutines will get cancelled
310310
launch {
311311
launch {
312312
throw IOException() // the original exception
313313
}
314314
}
315315
}
316316
try {
317-
inner.join()
317+
innerJob.join()
318318
} catch (e: CancellationException) {
319319
println("Rethrowing CancellationException with original cause")
320320
throw e // cancellation exception is rethrown, yet the original IOException gets to the handler

kotlinx-coroutines-core/jvm/test/guide/example-exceptions-06.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ fun main() = runBlocking {
1414
println("CoroutineExceptionHandler got $exception")
1515
}
1616
val job = GlobalScope.launch(handler) {
17-
val inner = launch { // all this stack of coroutines will get cancelled
17+
val innerJob = launch { // all this stack of coroutines will get cancelled
1818
launch {
1919
launch {
2020
throw IOException() // the original exception
2121
}
2222
}
2323
}
2424
try {
25-
inner.join()
25+
innerJob.join()
2626
} catch (e: CancellationException) {
2727
println("Rethrowing CancellationException with original cause")
2828
throw e // cancellation exception is rethrown, yet the original IOException gets to the handler

0 commit comments

Comments
 (0)