Skip to content

Commit 6847661

Browse files
Fix the 'Coroutine Exceptions handling' doc (#2917)
1 parent 4d1c216 commit 6847661

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/topics/exception-handling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When these builders are used to create a _root_ coroutine, that is not a _child_
1515
the former builders treat exceptions as **uncaught** exceptions, similar to Java's `Thread.uncaughtExceptionHandler`,
1616
while the latter are relying on the user to consume the final
1717
exception, for example via [await][Deferred.await] or [receive][ReceiveChannel.receive]
18-
([produce] and [receive][ReceiveChannel.receive] are covered later in [Channels](https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/channels.md) section).
18+
([produce] and [receive][ReceiveChannel.receive] are covered in [Channels](https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/channels.md) section).
1919

2020
It can be demonstrated by a simple example that creates root coroutines using the [GlobalScope]:
2121

@@ -68,7 +68,7 @@ Caught ArithmeticException
6868
## CoroutineExceptionHandler
6969

7070
It is possible to customize the default behavior of printing **uncaught** exceptions to the console.
71-
[CoroutineExceptionHandler] context element on a _root_ coroutine can be used as generic `catch` block for
71+
[CoroutineExceptionHandler] context element on a _root_ coroutine can be used as a generic `catch` block for
7272
this root coroutine and all its children where custom exception handling may take place.
7373
It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)).
7474
You cannot recover from the exception in the `CoroutineExceptionHandler`. The coroutine had already completed
@@ -349,7 +349,7 @@ hierarchy of coroutines. Let us take a look at the case when unidirectional canc
349349

350350
A good example of such a requirement is a UI component with the job defined in its scope. If any of the UI's child tasks
351351
have failed, it is not always necessary to cancel (effectively kill) the whole UI component,
352-
but if UI component is destroyed (and its job is cancelled), then it is necessary to fail all child jobs as their results are no longer needed.
352+
but if the UI component is destroyed (and its job is cancelled), then it is necessary to cancel all child jobs as their results are no longer needed.
353353

354354
Another example is a server process that spawns multiple child jobs and needs to _supervise_
355355
their execution, tracking their failures and only restarting the failed ones.

0 commit comments

Comments
 (0)