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.

RxJava 2.0.6 : New undeliverable error handling

See original GitHub issue

In the release docs of 2.0.6 it is stated that

If an undeliverable exception is an instance/descendant of NullPointerException, IllegalStateException (UndeliverableException and ProtocolViolationException extend this), IllegalArgumentException, CompositeException, MissingBackpressureException or OnErrorNotImplementedException, the UndeliverableException wrapping doesn’t happen.

What is the reason for that? Also I cannot confirm this behaivor. If I understand correctly

RxJavaPlugins.setErrorHandler(throwable -> {
    if (throwable instanceof OnErrorNotImplementedException) {
        throw new RuntimeExecutionException(throwable);
    }
    Timber.e(throwable, "Error handler reported");
});

Single.fromCallable(() -> {
    throw new IllegalArgumentException();
}).subscribe(o -> Timber.d("onSuccess"));

This should not be wrapped and thus not be re-thrown. But it is.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
akarnokdcommented, Feb 16, 2017

Don’t rethrow and let the app crash. On Android, you can call Thread.currentThread().getUncaughtExceptionHandler().handleException(throwable) and it will crash the app for you.

0reactions
akarnokdcommented, Apr 11, 2017

Looks like this question has been answered. If you have further input on the issue, don’t hesitate to reopen this issue or post a new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RxJava2 UndeliverableException - ProAndroidDev
Today I started to got an error from Firebase Testlab due to UndeliverableException like below io.reactivex.exceptions.
Read more >
The RxJava2 Default Error Handler | by Bryan Herbst - Medium
OnErrorNotImplementedException is one of the “bug” cases that RxJava does not wrap in an UndeliverableException , since it generally means that ...
Read more >
java - io.reactivex.exceptions.UndeliverableException The ...
My question is where should I write this code. I have a Micronaut application using java or this is the only way to...
Read more >
Standard Error Handler in RxJava2 or why RxJava causes the ...
Starting with the version 2.0.6 , it RxJavaPlugins.onError tries to be smarter and shares the library / implementation errors and situations ...
Read more >
io.reactivex.exceptions.UndeliverableException Java Examples
setErrorHandler(e -> { if (e instanceof UndeliverableException) { // As ... new RuntimeException("Unexpected Throwable in RxJavaPlugins error handler", ...
Read more >

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