Skip to content

Commit 1f65af2

Browse files
elizarovqwwdfsad
authored andcommitted
Fix example-flow-14 docs to show expected exception in text
Fixes #1582
1 parent 7f0da42 commit 1f65af2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/flow.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,15 @@ fun main() = runBlocking<Unit> {
708708
709709
This code produces the following exception:
710710

711-
<!--- TEST EXCEPTION
711+
```text
712712
Exception in thread "main" java.lang.IllegalStateException: Flow invariant is violated:
713713
Flow was collected in [CoroutineId(1), "coroutine#1":BlockingCoroutine{Active}@5511c7f8, BlockingEventLoop@2eac3323],
714714
but emission happened in [CoroutineId(1), "coroutine#1":DispatchedCoroutine{Active}@2dae0000, DefaultDispatcher].
715715
Please refer to 'flow' documentation or use 'flowOn' instead
716716
at ...
717-
-->
717+
```
718+
719+
<!--- TEST EXCEPTION -->
718720

719721
> Note that we had to use a fully qualified name of the [kotlinx.coroutines.withContext][withContext] function in this example to
720722
demonstrate this exception. A short name of `withContext` would have resolved to a special stub function that

0 commit comments

Comments
 (0)