You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/exception-handling.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ When these builders are used to create a _root_ coroutine, that is not a _child_
15
15
the former builders treat exceptions as **uncaught** exceptions, similar to Java's `Thread.uncaughtExceptionHandler`,
16
16
while the latter are relying on the user to consume the final
17
17
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).
19
19
20
20
It can be demonstrated by a simple example that creates root coroutines using the [GlobalScope]:
21
21
@@ -68,7 +68,7 @@ Caught ArithmeticException
68
68
## CoroutineExceptionHandler
69
69
70
70
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
72
72
this root coroutine and all its children where custom exception handling may take place.
73
73
It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)).
74
74
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
349
349
350
350
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
351
351
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.
353
353
354
354
Another example is a server process that spawns multiple child jobs and needs to _supervise_
355
355
their execution, tracking their failures and only restarting the failed ones.
0 commit comments