question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

io.reactivex.exceptions.CompositeException: 3 exceptions occurred.

See original GitHub issue

image

Test code:

fun main() {
    /*RxJavaPlugins.setErrorHandler {
        it.cause?.let {
            throw it
        }
    }*/

    val obs1 = Observable.create<String> {
        it.onError(Throwable())
    }
    val obs2 = Observable.create<String> {
        it.onError(Throwable())
    }
    val obs3 = Observable.create<String> {
        it.onError(Throwable())
    }
    val obs4 = Observable.create<String> {
        Thread.sleep(1000)
        it.onError(Throwable())
    }.subscribeOn(Schedulers.io())

    val composite = CompositeDisposable()

    val dis = Observable.mergeDelayError(arrayListOf(obs1, obs2, obs3, obs4)).subscribe({
        print(it)
    }, {
        print(it.message)
    })
    composite.add(dis)
    composite.clear()

}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akarnokdcommented, Dec 13, 2019

Please read https://github.com/ReactiveX/RxJava/wiki/What’s-different-in-2.0#error-handling . Exceptions gathered by mergeDelayError are reported to the global error handler upon disposing the sequence so that errors possibly important to the developer are not lost.

0reactions
yanweiqiangcommented, Dec 13, 2019

Again, exceptions gathered by mergeDelayError are reported to the global error handler upon disposing the sequence. Where did you set RxJavaPlugins.setErrorHandler(e -> { });?

I’m very sorry, it’s my fault. I think because my code logic has something wrong. The RxJavaPlugins.setErrorHandler(e -> { }); set after the exception occured. Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - io.reactivex.exceptions.CompositeException ...
The actual exception thrown is a CompositeException , so that is why it doesn't match ExceptionHandler<GlobalException, HttpResponse> .
Read more >
CompositeException (RxJava Javadoc 3.1.5) - ReactiveX
Represents an exception that is a composite of one or more other exceptions. A CompositeException does not modify the structure of any exception...
Read more >
io.reactivex.exceptions.CompositeException Java Examples
This page shows Java code examples of io.reactivex.exceptions.CompositeException.
Read more >
io.reactivex.exceptions.CompositeException.<init> java code ...
Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions. Popular methods of CompositeException. getExceptions.
Read more >
Java Examples for rx.exceptions.CompositeException
This java examples will help you to understand the usage of rx.exceptions.CompositeException. ... CompositeException: 2 exceptions occurred. } Example 3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found