Skip to content

Commit f22b229

Browse files
fix the link to Thread.uncaughtExceptionHandler
1 parent 515308d commit f22b229

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/topics/exception-handling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The output of this code is (with [debug](https://github.com/Kotlin/kotlinx.corou
6060

6161
```text
6262
Throwing exception from launch
63-
Exception in thread "DefaultDispatcher-worker-2 @coroutine#2" java.lang.IndexOutOfBoundsException
63+
Exception in thread "DefaultDispatcher-worker-1 @coroutine#2" java.lang.IndexOutOfBoundsException
6464
Joined failed job
6565
Throwing exception from async
6666
Caught ArithmeticException
@@ -73,7 +73,7 @@ Caught ArithmeticException
7373
It is possible to customize the default behavior of printing **uncaught** exceptions to the console.
7474
[CoroutineExceptionHandler] context element on a _root_ coroutine can be used as a generic `catch` block for
7575
this root coroutine and all its children where custom exception handling may take place.
76-
It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)).
76+
It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler-java.lang.Thread.UncaughtExceptionHandler-).
7777
You cannot recover from the exception in the `CoroutineExceptionHandler`. The coroutine had already completed
7878
with the corresponding exception when the handler is called. Normally, the handler is used to
7979
log the exception, show some kind of error message, terminate, and/or restart the application.

kotlinx-coroutines-core/jvm/test/guide/test/ExceptionsGuideTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ExceptionsGuideTest {
99
fun testExampleExceptions01() {
1010
test("ExampleExceptions01") { kotlinx.coroutines.guide.exampleExceptions01.main() }.verifyExceptions(
1111
"Throwing exception from launch",
12-
"Exception in thread \"DefaultDispatcher-worker-2 @coroutine#2\" java.lang.IndexOutOfBoundsException",
12+
"Exception in thread \"DefaultDispatcher-worker-1 @coroutine#2\" java.lang.IndexOutOfBoundsException",
1313
"Joined failed job",
1414
"Throwing exception from async",
1515
"Caught ArithmeticException"

0 commit comments

Comments
 (0)